Files
api-collections/collections/elixForms API v2/EFTL processing/CCT - Liquidazione Compensi/Proposta/Elenco partecipanti per tendina.yml
T

67 lines
3.1 KiB
YAML

info:
name: Elenco partecipanti per tendina
type: http
seq: 12
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: |-
{
"userDocument": "{{elixBase64EftlDocument}}", // see the pre-request script
"userContext": {
"lang": "IT",
"crlf": "\r\n"
}
}
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="elencoPartecipantiDebug" type="string"][% elencoPartecipantiDebug = ""; %][/VAR]
[VAR name="elencoPartecipantiCompleto" type="string"][% elencoContraentiCompleto = ""; %][/VAR]
[VAR name="partecipanti" type="string"][TRIM][TAG]SCHEMAID,542,COL0018,IUQOID, , [/TAG][/TRIM][/VAR]
[%= "" %]
[IF][CONDITION][IS_NOT_EMPTY varname="partecipanti" /][/CONDITION][THEN]
[VAR name="partecipantiSplit" type="iterable"][SPLIT regex="\n"][VALUE_OF varname="partecipanti" /][/SPLIT][/VAR]
[VAR name="partecipantiCount" type="number"][SIZE_OF varname="partecipantiSplit" /][/VAR]
[VAR name="partecipanteIdx" type="number"][% partecipanteIdx = 0; %][/VAR]
[VAR name="partecipanteNominativoIdx" type="number"][% partecipanteNominativoIdx = 0; %][/VAR]
[VAR name="partecipanteRestoIdx" type="number"][% partecipanteRestoIdx = 1; %][/VAR]
[WHILE threshold="99"][CONDITION][% partecipanteIdx < partecipantiCount %][/CONDITION][DO]
[VAR name="partecipanteFull" type="string"][VALUE_OF varname="partecipantiSplit" index="partecipanteIdx" /][/VAR]
[VAR name="partecipanteSplit" type="iterable"][SPLIT regex=", CF: "][TRIM][VALUE_OF varname="partecipanteFull" /][/TRIM][/SPLIT][/VAR]
[!-- Recupera il nominativo --]
[VAR name="partecipanteNominativo" type="string"][VALUE_OF varname="partecipanteSplit" index="partecipanteNominativoIdx" /][/VAR]
[!-- Recupera il codice fiscale --]
[VAR name="partecipanteResto" type="string"][VALUE_OF varname="partecipanteSplit" index="partecipanteRestoIdx" /][/VAR]
[VAR name="partecipanteRestoSplit" type="iterable"][SPLIT regex=", Qualifica: "][VALUE_OF varname="partecipanteResto" /][/SPLIT][/VAR]
[VAR name="partecipanteCodiceFiscale" type="string"][VALUE_OF varname="partecipanteRestoSplit" index="partecipanteNominativoIdx" /][/VAR]
[%= "[" %][FORMAT type="number" pattern="integer"][% partecipanteIdx + 1 %][/FORMAT][%= "] " + partecipanteNominativo + " (CF: " + partecipanteCodiceFiscale + ")" %]
[% partecipanteIdx = partecipanteIdx + 1; %]
[/DO][/WHILE]
[/THEN][/IF]
[/EFTL]
`);
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5