I’m using PandaDoc for an NDA document. I request the recipient to fill in a handful of fields, like: Name, Business Name, Title. I want to be able to capture that field data to bring into CRM, but the order of the collection data changes every time. I have a custom Field ID to help identify the fields, but I’m not sure how to extract and sort that collection data so I can use it in a step to update the CRM. Below is a quick Loom video to put a visual on what I’m looking to do:
Hello @Scot_Cockroft !
One way to do it is to play with the “map” function.
“map” is used to generate a new array from an existing array, keeping only 1 field. And, it allows you to search for a specific field value.
This allows you to generate an array with, for example, all “Name” where “FieldID=repTitle”.
With a combination of functions in a mapping, you can extract the relevant data from the array.
See this example I built
This is my data. An array with misc fields, as well as a collection.
And this is how I extract the different fields.
- First one: from the array data, I extract “Value” for which “fieldID=repTitle”. Since “map” generates a new array, I use “first” to pick the only item I found.
- Second one: from the array data, I extract “assignee_details.first” for which “fieldID=benDemo”, and I pick the first an only field.
Be careful; when you type the name of the fields, you have to make sure you use the “raw” name of that field. For that, you have to hover your mouse on the field, it will show you the raw name of it. (in my case it’s the same as displayed, but in some cases it’s different). See here:
I attach the blueprint of my example scenario:
Extracting data from Array with functions.json (5.2 KB)
Benjamin