Specify Multiple Paths to Records in HTTP response

Hello,

I have a flow in which I am pulling conversation details from an HTTP connection into NetSuite.

The HTTP connection has a generic "conversations" endpoint, which returns data in this basic structure:

{

"email_conversations":[

...

],

"phone_calls":[

...

]

}

Currently, the flow is processing the emails only, using a "Path to records in HTTP response" of "emails" to enable filtering the emails as individual records.

I am trying to add the phone calls to the flow, and I had these ideas for possible ways to accomplish this, but none of them seem ideal:

1. Create separate lookup steps to the same endpoint, extracting different records each time.

2. Call the lookup once, but use the root record, and use a filter script to manipulate the page.

3. Call the lookup once, using the root record and without filtering. Then, use path to many and input filters on later stages.

The first is clearly inefficient and not ideal. The issue with the second is that it removes the ability to filter the conversations on an individual record basis, which would be preferred. Likewise, the third will require that we duplicate filters and remember to add them every time a step is added to the flow.

It would seem like the ideal solution would be something like setting "Path to records in HTTP response" to "emails_conversations,phone_calls" so I could work on each record in both arrays. When I try that syntax, it appears Integrator.io is looking for a field with that name and throws an error.

Is this sort of path to records possible? Or am I overlooking a better way of accomplishing this?

I appreciate your insight.

Thank you,

Ezriah

@ezriah I would recommend you use a preSavePage script to handle this. So I would not set anything in the "Path to records in HTTP response" field and then I would "re-recordize" within the script. The output will then give you records for phone calls and records for email conversations that you can then branch off of downstream or use input filters for when you need one or the other. Alternatively, you could have use one-to-many path on your downstream lookup and import steps, but that would require you to do it for each step. Here is an example of the script and using Celigo AI:

function preSavePage(options) {
// Logic to modify the data
let modifiedData = [];
options.data.forEach(record => {
// Extract email conversations
if (record.email_conversations) {
record.email_conversations.forEach(email => {
modifiedData.push({
type: 'email_conversation',
...email
});
});
}
// Extract phone calls
if (record.phone_calls) {
record.phone_calls.forEach(call => {
modifiedData.push({
type: 'phone_call',
...call
});
});
}
});

// Return the modified data
return {
data: modifiedData,
errors: options.errors,
abort: false,
newErrorsAndRetryData: []
};
}