Skip to main content

Hi there

 

I have a Configurable List widget in my Jotform, and would like Zapier to just pull the ages of the child through to a column in Monday:

 

 

I’ve been playing around with different codes but ultimately, it’s not working. What’s the best way to do this, especially when each form submission may have a different amount of ‘numbers’ (ie. someone might have 2 kids, or 5 kids etc).

 

I’d then like for the total number of numbers (ie. 5 if there are 5 children) to come through to a different column on Monday. 

 

Thanks for your help in advance, I am stuck!

Hi @ellieroberts 

For us to have more info, post screenshots with how the data is returned from the Jotform Zap trigger step.


Thanks for your response @Troy Tessalone 

 

This is how it appears - it is in one strand:

 

 

Eg: E{"Full name of child":"Ellie","Age":"1"},{"Full name of child":"Ellie","Age":"3"},{"Full name of child":"E","Age":"6"}]


@ellieroberts

The data is returned as raw JSON.

You’ll have to use Code to convert the data into variables that can be mapped.

 

let RAW = JSON.parse(inputData.RAW);

output = {RAW}];

 

 


Sorry @Troy Tessalone for the dumb questions. Do I enter it like this? 

 

 

I get this error:

 


@ellieroberts 

Change this to just: RAW

 


Thanks @Troy Tessalone It came through to Monday, but the column that I have mapped to in Monday is still empty. I then got this error email from Zapier: 

 

 

 

 


@ellieroberts

What type of field is each in Monday?

Can you show screenshots with how your Zap steps are configured in EDIT mode so we can see the field types/descriptions?

Would need to see the DATA IN/OUT for each Zap step from the Zap Runs: https://zapier.com/app/history/


Many thanks @Troy Tessalone - really appreciate your help!

  1. They are currently all text columns in Monday.com
  2. /3. See below, hopefully this helps but let me know if you need anything else!

 


@ellieroberts

This shows the input of the Code step as plain text not raw JSON, thus why the Code encountered an error because there was no JSON to parse.

 

Different code logic would need to be used if the Code step input value will be plain text.

 

Try this code:

let TXT = inputData.TXT || "";

let ChildAges = =];
let ChildNames = =];

if (TXT.includes("Age")) {
TXT = TXT.replace(/\n/g,"|").replace(/\|\|/g,"|");
const result = extractChildData(TXT);
}

// Function to process the input string and extract child ages and names
function extractChildData(input) {
const parts = input.split('|');

for (let i = 0; i < parts.length; i += 2) {
const agePart = partsti];
const namePart = partsti + 1];

const age = parseInt(agePart.split(': ')'1]);
const name = namePart.split(': ')'1];

ChildAges.push(age);
ChildNames.push(name);
}

return { ChildAges, ChildNames };
}

ChildAges = ChildAges.join(", ");
ChildNames = ChildNames.join(", ");

output = ={ChildAges, ChildNames}];

 


@Troy Tessalone Still having troubles, unfortunately!


@ellieroberts 

Need to see screenshots of the DATA IN/OUT from the Zap Run to have context about the error.


@Troy Tessalone 

 


@ellieroberts 

The Code step is still using the old JavaScript to parse JSON.

See above in the thread for the new JavaScript to use to parse the TEXT.

 

 


Thanks so much @Troy Tessalone, really appreciate your help. That seems to be working better now but it still isn’t coming through to Monday. 

 

 

 


@ellieroberts 

Check the DATA OUT to see the returned Monday Item ID.

In Monday, click on a Monday Item to see the Item ID in the browser URL.

Then you can use the Monday Item ID from the Zap step DATA OUT to adjust the browser URL to go directly to the Monday Item ID that was tested with to make sure you are looking at the correct Monday Item ID.

 


Thanks @Troy Tessalone - it’s definitely the right item, everything comes through except the ages. When I run a test on Zapier, it works great but doesn’t when I submit a form.

 

 


@ellieroberts 

Check if there are other Zaps or native Monday Automations that are overwriting the column value after the Monday Item is created.


@Troy Tessalone none that I can see. It looks like the code step is breaking down again. Sorry for being so annoying!

 

 


@ellieroberts 

In order to have context about the Zap Code step error, we need to see screenshots of the DATA OUT from Step 1 and ALL the DATA IN for Zap step 2.


@Troy Tessalone  

 


@ellieroberts 

Based on the DATA IN, the Code step is using the OLD JavaScript code.

Make sure to update the Zap Code step to use the NEW JavaScript code.

 

 

let TXT = inputData.TXT || "";

let ChildAges = ];
let ChildNames = ];

if (TXT.includes("Age")) {
TXT = TXT.replace(/\n/g,"|").replace(/\|\|/g,"|");
const result = extractChildData(TXT);
}

// Function to process the input string and extract child ages and names
function extractChildData(input) {
const parts = input.split('|');

for (let i = 0; i < parts.length; i += 2) {
const agePart = partsri];
const namePart = partsri + 1];

const age = parseInt(agePart.split(': ') 1]);
const name = namePart.split(': ') 1];

ChildAges.push(age);
ChildNames.push(name);
}

return { ChildAges, ChildNames };
}

ChildAges = ChildAges.join(", ");
ChildNames = ChildNames.join(", ");

output = {ChildAges, ChildNames}];

 


Sorry @Troy Tessalone - am I not entering the code properly?

 

 


@ellieroberts 

Did you republish the Zap after updating the Zap Code step?

Did you try testing after the Zap was republished?


Oh my goodness, it worked! Thank you so so much, really appreciate your help @Troy Tessalone 


Reply