Question

bundle.inputData for line items is not structured as a nested entity

  • 15 September 2021
  • 1 reply
  • 219 views

Userlevel 1

I have a Line Item Group in my Action for which I want to convert them into a Nested Entity for my API through code. To Identify these fields as nested entity, I want the bundle.inputData to structure the line item data as a nested entity. i.e. 

"inputData" : {

        "line_item_group_key" : {

               “CT” : “CV1”

        }

}

But after I input the value for the line item in the input form, the data is flattened out and it is present as a normal field.

"inputData" : {
"CT" : "CV1"
}

How Can I Get the line item fields to be grouped under a nested entity in bundle.inputData?

One more thing to note is the Line Item Group is a Dynamic Field so the Keys for these line items are generated on the fly and I can’t identify them as they belong to a nested entity.

Line Item Group  Generated Dynamically in Input Form

 

Input Data as shown in “Test and Review” step of Action

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Hi,

We saw a similar problem, we were able to work around it by modifying the data before sending it.

https://github.com/invoiceninja/zapier/blob/master/resources/invoice.js#L70

Hope this helps