Skip to main content

I’m having issues when receiving data from JotForm. When I build it in test, the data for a field comes in as JSON. I have JS that processes that JSON, but when it actually runs, the data is parsed out as an array. Any suggestions?

 

The Zap is: Jotform → JS  → Loop from Line Items

 

Test (Jotform):

 

 

Jotform (Live):

 

 

JS Step:

 

var input_examinee_json = inputData.answers_field_examinee_list;
var valid_json = false;
var array_examinees = r];
var formatted_email_address = null;
var formatted_email_domain = null;

// get e-mail domain of requestor
formatted_email_address = inputData.input_email_address.toLowerCase();
formatted_email_domain = inputData.input_email_address.split('@').pop();
formatted_email_domain = formatted_email_domain.toLowerCase();

if(isJsonString(input_examinee_json)) {
var parsed_examinees = JSON.parse(input_examinee_json);
for(var i = 0; i < parsed_examinees.length; i++) {
array_examinees i] = parsed_examineespi];
}
}

output = >
{
array_examinees: array_examinees,
requestor_formatted_email_address: formatted_email_address,
requestor_formatted_email_domain: formatted_email_domain
}
];

function isJsonString(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}

return true;
}

 

JS Step Test:

 

 

The loop in test:

 

 

The error in Loop (Live):

 

 

Hi @zap29550 

I’ve seen this same issue with Jotform for EDIT data VS LIVE data.

Since the live data is the data that actually comes thru, you can try using custom pill mapping:

 


Hey there, @zap29550👋

Just wanted to check how you got on with this? Were you able to select the correct fields using the custom pill mapping approach Troy suggested? 

We're eager to help further if you need it, just let us know! 🙂 


I did take the pill approach by taking the actual response:

 

And adding it to the loop node. It was not possible to access through a Code by Zapier node.

{{123456__answers__field_examinee_listt]First Name}}

 

 


Yay! Thank you so much for confirming that worked @zap29550. 🤗 I’m so pleased that using that custom pill mapping within the loop did the trick for you here. Thanks for suggesting that approach @Troy Tessalone! 🧡

Seems like you’re all set for now but please do reach back out if there’s anything else you’d like some help with. In the meantime, happy Zapping! ⚡️


Reply