info: name: Calcolo importo per singolo partecipante type: http seq: 16 http: method: POST url: "{{elixFormsApiUrl}}/eftl/process/v1" headers: - name: x-requested-with value: XMLHttpRequest - name: x-api-key value: "{{elixFormsWsAuthenticationToken}}" - name: x-ef-request-id value: "22737" disabled: true - name: x-ef-request-id value: "22224" disabled: true - name: x-ef-request-id value: "22744" disabled: true - name: x-ef-request-id value: "23258" body: type: json data: |- { "userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script "userContext": { "lang": "IT", "crlf": "\r\n", "qualificheDocenti": ";Docente;Ricercatore;" } } auth: inherit runtime: scripts: - type: before-request code: |- const { prepareEftlDocument } = require("./elixFormsJs.js") // Copy-pasta your EFTL document below inside the template literals (`) prepareEftlDocument(String.raw` [EFTL][HEADER name="trimDocument" value="true" type="boolean" /] [VAR name="arrayCFdocenti" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_DOCENTE,REQUEST,IUQOID[/TAG][/VAR] [VAR name="arrayCFaltro" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTI_QUALIFICA_ALTRO,REQUEST,IUQOID[/TAG][/VAR] [VAR name="importoDocente" type="number"][% importoDocente = 0; %][/VAR] [VAR name="importoAltro" type="number"][% importoAltro = 0; %][/VAR] [VAR name="lastUpdatedNominativo" type="string"][TAG]GETVALUEBYTAG,PARTECIPANTE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] [VAR name="lastUpdatedImporto" type="string"][TAG]GETVALUEBYTAG,IMPORTO_RIPARTIZIONE,REQUEST,IUQOID,UPDATED_LAST[/TAG][/VAR] [VAR name="firstItem" type="number"][% firstItem = 0; %][/VAR] [VAR name="secondItem" type="number"][% secondItem = 1; %][/VAR] [VAR name="lastUpdatedNominativoIterable" type="iterable"][SPLIT regex=" \(CF: "][VALUE_OF varname="lastUpdatedNominativo" /][/SPLIT][/VAR] [VAR name="lastUpdatedNominativoRightIterable" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="lastUpdatedNominativoIterable" index="secondItem" /][/SPLIT][/VAR] [VAR name="lastUpdatedNominativoCF" type="string"][VALUE_OF varname="lastUpdatedNominativoRightIterable" index="firstItem" /][/VAR] [IF] [CONDITION][CONTAINS varname="arrayCFdocenti" value="lastUpdatedNominativoCF" /][/CONDITION] [THEN][% importoDocente = lastUpdatedImporto; %][/THEN] [ELSE][% importoAltro = lastUpdatedImporto; %][/ELSE] [/IF] [TAG]GETVALUEBYTAG,IMPORTO_RIPARTIZIONE,REQUEST,IUQOID,,,"#,###.00"[/TAG] [%= crlf %] [TAG]SCHEMAID,717,COL0010,IUQOID, , ,,"#,###.00"[/TAG] [%= crlf %] [%= importoDocente %] [%= crlf %] [%= importoAltro %] [/EFTL] `); settings: encodeUrl: true timeout: 0 followRedirects: true maxRedirects: 5