I’m using Pipedrive trigger and getting product details as line items to a Code zap:
The flow
The input data:
When I test, it appears that empty values are stripped out. Here is how “Data in” looks:
Because of that, I’m not able to retrieve the corresponding product values when looping through the line items since because index order is being broken.
Any advice for workaround?
Best answer by Troy Tessalone
@Digital Partner
You need to remove the extra fields.
You need to map all of the product fields from Pipedrive that you want to use in the Code step to be handled by the Formatter step
See screenshot below as an example where 2 array fields are mapped and separated by a pipe for the fields and a ^ for each line item
That outputs a “text” variable that is a block of concatenated text
That is what should be mapped as an input into the Code step
Then in the Code step you can split by ^ to get the line items, then split by | to get the different fields to use for each line item
This is because Code step inputs flatten any arrays to text thus losing their structure, so you have to create a text structure for the array items before passing into the Code step
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.
You need to map all of the product fields from Pipedrive that you want to use in the Code step to be handled by the Formatter step
See screenshot below as an example where 2 array fields are mapped and separated by a pipe for the fields and a ^ for each line item
That outputs a “text” variable that is a block of concatenated text
That is what should be mapped as an input into the Code step
Then in the Code step you can split by ^ to get the line items, then split by | to get the different fields to use for each line item
This is because Code step inputs flatten any arrays to text thus losing their structure, so you have to create a text structure for the array items before passing into the Code step