Sometimes, you may need to filter or create branches in your flow based on a field that is nested within an array. Unfortunately, fields like these often don't appear in the dropdown menu, and entering them as an expression directly in the UI won't work either. For example, if you're looking for a field like order_lines.0.sku, it will not be available in the dropdown or directly usable in expressions within input filters, output filters, or branching rules.
The backend fully supports referencing nested fields, but the UI doesn't currently allow typing in fields that aren't in the dropdown. To work around this:
-
Use the ZangaBox Chrome Extension:
This tool allows you to directly edit and update the flow JSON without needing to use Postman or manually call APIs.
-
Steps to Edit Your Flow:
- Open the ZangaBox extension while viewing your flow, export, or import.
- Locate the filter, output filter, or branching rules you want to update.
- Update the relevant field to include the nested array path (e.g.,
order_lines.0.sku).
- Save the changes by clicking PUT.
We’re actively working on reimagining the branching and filter UI (hopefully this year) to address this issue. Future updates will also include support for Handlebars expressions in these scenarios.
1 Like
Alternatively, you could extract the field you later want to filter on. You would either do this on a transformation on your export or within response/result mapping after an import or lookup. The only caveat is this alternative method would not work when using one-to-many on an import or lookup step. If that is you're case, then the original method in this post would work or you would need a postResponseMap script on your import/lookup that has one-to-many set and the results/response from it has the field you want to later filter on.
Export transform:
Lookup result mapping:
Import response mapping:
Example postResponseMap script for the one-to-many use cases:
function postResponseMap(options) {
options.postResponseMapData.forEach(record => {
if (record.applications && record.applications.length > 0) {
const applicationDetails = record.applications[0].applicationdetails;
if (applicationDetails && applicationDetails.properties) {
record.tier = applicationDetails.properties.tier;
record.company_type = applicationDetails.properties.company_type;
}
}
});
return options.postResponseMapData;
}
Follow up question to this. I would like to create branches based on arrays. I have a JSON records that has multiple arrays in one record. I’d like to send each array to a different table in Snowflake. Currently I have the flow sequential. So the entire JSON record is being passed from import to import. This seems inefficient and expensive on resources. Is it possible at time of the data flowing into Celigo to specify which part of a JSON record go to which import using branching. This would then only send that part of the record thus saving time etc. Attached is an example of a flow. I’d like to branch after the second step. Happy to share more.
Happy Holidays 
I’d make a branch after GetLoanByLoanNumber; the branch type would be ALL, and there would be no criteria for the branches. This means the record gets duplicated to each branch. Then each branch has one import, and that import goes to the table you want, with mappings specific to that table.