Multi value node from trigger getting dropped in action

I have an automation that is reading workorders from salesforce and creating invoices in intacct.
UUID: 2f7afd148b5540fa80a99a106fec681f

The trigger queries and returns the workorder with multiple lines. The action uses that to create the invoice. On the workorder data there is a field for coupon code. Not every line will contain the code. Typically i would expect that to fill in a null value for any empty line. for example, i have a workorder with two lines. only one has the coupon

Line Item Amount Total:
	[11.0]
	[88.0]

Line Item Coupon:
	[WAW2for99]

Line Item Product Code:
	[4200]
	[4000]

This coupon should apply to the second line. When i process it, it gets dropped completely and doesnt get read. If I have the code on all lines, it works fine.

This was working until recently, this one is a copy of 3caa25bcad074d098fb2b9680daa92f8. No changes to the code were made. The company was going through a merge so we had to have multiple versions going for each set of credentials.

Any ideas what would cause it to get dropped like that?

edit…If you want to look at the specific one I mentioned here, it was the run on may 6 10:20

Hi Brent,

Please send me a link to the log where it is happening, I am unable to find it:

https://avt-connect.com/automation-editor?view_history_item=239524&view_history_item_record_uuid=f0e93dee5f304fce84e82b449cace822&view_history_item_trigger_row_unique_id=0WO2K0000009R6qWAE00212754&view_history_item_step_uuid=df149b48798f4b4187dd3fbe7349df0d&view_history_item_tenant_uuid=&view_history_item_person_uuid=2f5972e4272b43b380ea5420dba023b7

The source of trouble is the API response in trigger e5d847b1902c4cfd87946e2c96f740e4:

The API is not returning a consistent schema, such that the schema for the 2nd row having a coupon does not match the schema of the 1st row without a coupon. This in turn messes up Trigger module #7 when it fetches values for coupons:

This is generally a thorny issue whenever working with trigger API’s that emit array data like line items but don’t emit the same schema for each array element.

Sorry, there’s not a general way I’ve found to address this. The only solution I have been able to think of is to use custom Java code to scrub the array elements and insert missing schema elements as needed for the trigger output such that each array element is the same.

For your case, this would mean looping through each line item. Where a coupon is null, you would replace that null node with this schema containing empty node values:

The goal is to make the xpath for the coupons in module Trigger #7 select the same number of elements as all the other xpaths selecting line item data.

Make sense?

Actually, maybe there is a way to build a generic module that could sanitize data rows to clean up schema like this. I will make a note and give it a try one day, but not something I can provide in the very near timeframe.

Thanks. They must have changed something as it was working until recently. maybe api version or something.

I will look into it. thanks

Unfortunately life as an API Integrator can be challenging, depending on the API’s involved.

yeah. tell that to my clients. ha

Hi Brent,

Wanted to let you know the forthcoming v6.53 release has a new “Data Rows - Standardize Schema” module that will add nodes and attributes as needed to make all data rows have the same XML schema.

For example, given the following XML:

<root>
    <row>
        <item>1</item>
    </row>
    <row>
        <item>2<subitem>22</subitem></item>
    </row>
    <row>
        <item attr="3a">3</item>
    </row>
</root>

If configured to process data rows root/row, the output will be:

<root>
    <row>
        <item attr="">1<subitem></subitem></item>
    </row>
    <row>
        <item attr="">2<subitem>22</subitem></item>
    </row>
    <row>
        <item attr="3a">3<subitem></subitem></item>
    </row>
</root>