info: name: Elenco partecipanti per tendina type: http seq: 3 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: "19375" body: type: json data: "{\r \ \"userDocument\": \"{{elixBase64EftlDocument}}\", // see the pre-request script\r \ \"userContext\": {\r \ \"lang\": \"IT\",\r \ \"crlf\": \"\\r\\n\"\r \ }\r }" auth: inherit runtime: scripts: - type: before-request code: "// Copy-pasta your EFTL document below inside the template literals (`)\r var eftlDocumentToBeProcessed = String.raw`\r [EFTL][HEADER name=\"trimDocument\" value=\"true\" type=\"boolean\" /]\r [VAR name=\"elencoPartecipantiDebug\" type=\"string\"][% elencoPartecipantiDebug = \"\"; %][/VAR]\r [VAR name=\"elencoPartecipantiCompleto\" type=\"string\"][% elencoContraentiCompleto = \"\"; %][/VAR]\r [VAR name=\"partecipanti\" type=\"string\"][TRIM][TAG]SCHEMAID,542,COL0018,IUQOID, , [/TAG][/TRIM][/VAR]\r [%= \"\" %]\r [IF][CONDITION][IS_NOT_EMPTY varname=\"partecipanti\" /][/CONDITION][THEN]\r [VAR name=\"partecipantiSplit\" type=\"iterable\"][SPLIT regex=\"\\n\"][VALUE_OF varname=\"partecipanti\" /][/SPLIT][/VAR]\r [VAR name=\"partecipantiCount\" type=\"number\"][SIZE_OF varname=\"partecipantiSplit\" /][/VAR]\r [VAR name=\"partecipanteIdx\" type=\"number\"][% partecipanteIdx = 0; %][/VAR]\r [VAR name=\"partecipanteNominativoIdx\" type=\"number\"][% partecipanteNominativoIdx = 0; %][/VAR]\r [VAR name=\"partecipanteRestoIdx\" type=\"number\"][% partecipanteRestoIdx = 1; %][/VAR]\r [WHILE threshold=\"99\"][CONDITION][% partecipanteIdx < partecipantiCount %][/CONDITION][DO]\r [VAR name=\"partecipanteFull\" type=\"string\"][VALUE_OF varname=\"partecipantiSplit\" index=\"partecipanteIdx\" /][/VAR]\r [VAR name=\"partecipanteSplit\" type=\"iterable\"][SPLIT regex=\", CF: \"][TRIM][VALUE_OF varname=\"partecipanteFull\" /][/TRIM][/SPLIT][/VAR]\r [!-- Recupera il nominativo --]\r [VAR name=\"partecipanteNominativo\" type=\"string\"][VALUE_OF varname=\"partecipanteSplit\" index=\"partecipanteNominativoIdx\" /][/VAR]\r [!-- Recupera il codice fiscale --]\r [VAR name=\"partecipanteResto\" type=\"string\"][VALUE_OF varname=\"partecipanteSplit\" index=\"partecipanteRestoIdx\" /][/VAR]\r [VAR name=\"partecipanteRestoSplit\" type=\"iterable\"][SPLIT regex=\", Qualifica: \"][VALUE_OF varname=\"partecipanteResto\" /][/SPLIT][/VAR]\r [VAR name=\"partecipanteCodiceFiscale\" type=\"string\"][VALUE_OF varname=\"partecipanteRestoSplit\" index=\"partecipanteNominativoIdx\" /][/VAR]\r [%= \"[\" %][FORMAT type=\"number\" pattern=\"integer\"][% partecipanteIdx + 1 %][/FORMAT][%= \"] \" + partecipanteNominativo + \" (CF: \" + partecipanteCodiceFiscale + \")\" %]\r [% partecipanteIdx = partecipanteIdx + 1; %]\r [/DO][/WHILE]\r [/THEN][/IF]\r [/EFTL]\r `;\r \r var base64EncodedDocument = btoa(eftlDocumentToBeProcessed);\r \r bru.setVar(\"elixBase64EftlDocument\", base64EncodedDocument);" settings: encodeUrl: true timeout: 0 followRedirects: true maxRedirects: 5