Vars to fields Error Subflow

tomaslindev
Mega Guru

Hello everyone,
I am using a subflow to be able to execute a series of playbooks in my main flow.

I have called the subflow and I have replicated the fields as they are in the Playbook but in the "Vars to Fields" field it gives me error; I have previously raised a Look Up Record to the Contract Table and I have created flow variables with the same name to be able to associate those variables to the corresponding values but I can not associate the variable flows with the values of the look up record through the data pills dragging them, it sounds like there is some way to associate the data pills through code but I am not sure. Any idea?

 

tomaslindev_0-1753185056262.png

 

 

Thank you very much and greetings.

4 REPLIES 4

Vishal Jaswal
Giga Sage

Hello @tomaslindev 

 

vars to fields box doesn’t accept field data pill dragging, rather accepts plain text that is valid JSON

 

 So, use dot walking instead:


{
"u_backoffice" : "contract.u_administrative_data.u_cod_backoffice",
"u_cod_servicio" : "contract.vendor_contract",
"u_cod_cliente" : "contract.account.u_client_code",
"u_tipo_servidor": "contract.u_administrative_data.u_tipo_servidor_backoffice",
"u_cod_terminal" : "contract.u_administrative_data.u_id_terminal"
}

 

 


Hope that helps!

Hi @Vishal Jaswal ,

Thank you for your answer, currently if you see the image is what I have done and it continues to give me error, I do not know if you have to associate the flow variables to the values outside the script

Hello @tomaslindev 

 

Add a “Script” step before the subflow action. Inside the script, assign values from the lookup to the flow variables as:


flowVars.u_backoffice = contract.u_administrative_data.u_cod_backoffice;
flowVars.u_cod_servicio = contract.vendor_contract;
flowVars.u_cod_cliente = contract.account.u_client_code;
flowVars.u_tipo_servidor = contract.u_administrative_data.u_tipo_servidor_backoffice;
flowVars.u_cod_terminal = contract.u_administrative_data.u_id_terminal;

 

 

 

Then update your Vars to Fields JSON to only use the variable names, like this:

{
"u_backoffice": "u_backoffice",
"u_cod_servicio": "u_cod_servicio",
"u_cod_cliente": "u_cod_cliente",
"u_tipo_servicio": "u_tipo_servidor",
"u_cod_terminal": "u_cod_terminal"
}

 

 


Hope that helps!

I currently have no script options in the flow, could it do it through an action?