Workflow failed reason
Status: Open · Asked by Abhilesh Jha on · 0 views
This workflow is properly mapped but still failed, wanted to check the reason
Hello @taxajca,
We have escalated this concern to our technical team for further review. Please allow us some time, and we will get back to you with the update as soon as we have one.
Hi Abhilesh,
Greetings from Pabbly!
We reviewed your workflow and found that the inconsistency in mapping for cf_country_code and mobile is due to the way the incoming data is structured.
In some cases, these values are available directly at the top level of the response (e.g., "cf_country_code": "+91"), and mapping works perfectly. However, in other cases, they are embedded inside a nested field called custom_fields, which is a JSON array stored as a string.
Since Pabbly's direct mapping cannot extract values from within such stringified arrays, the mapping fails when the values are not available at the top level.
Recommended Solution:
To ensure consistent results, we suggest using the Code by Pabbly step to extract both cf_country_code and mobile from the custom_fields array. Here’s a sample code snippet you can use:
javascript
CopyEdit
let fields = JSON.parse(input.custom_fields); let result = { cf_country_code: "", mobile: "" }; for (let i = 0; i < fields.length; i++) { if (fields.api_name === "cf_country_code") { result.cf_country_code = fields.value; } if (fields.api_name === "mobile") { result.mobile = fields.value; } } return result;
This will ensure that both values are extracted correctly regardless of how the data is structured in each case.
Please feel free to reach out if you'd like help setting this up in your workflow—we’d be happy to assist you.
Hi Preeti,
Thanks for the valuable feedback, i have updated my workflow with certain modifications please review and let me know if thats fine
https://connect.pabbly.com/workflow/mapping/IjU3NjYwNTZhMDYzNTA0M2Q1MjY5NTUzNTUxMzYi_pc
also my name is Abhilesh & not Abhijeet :)
Hello Abhilesh,
We have reviewed the workflow setup, made minor updates to the mapping, and re-executed a task history. It now appears to be working fine. We recommend monitoring the workflow for some time and let us know if you face any issues going forward.
thanks