Thanks so much for your response/ideas. I always like doing things in one call vs. multiples once the process is proven. I'll probably stick with separate calls initially while I'm building. Easier to debug.
And I love your cool dropdown/hidden blurb -- how do you do that?!
Your questions:
Where is the data coming from? This is coming in as Output() from a call to AI Forms / Read Form Input action. If you haven't worked with this before, it is a crazy-complex structure but it is a string.
The form that is being read is an Invoice with a varying number of detail lines presented in two columns per page, going from 1 to 3 pages. In the Modeler, I have mapped each page/column's billing detail content to a table variable in the modeler: GenericDetail1A, GenericDetail1B, then GenericDetail2A, GenericDetail2B, GenericDetail3A, GenericDetail3B
When the AI Reader is executed it returns an output that contains these tables but only if they exist in the form being read. If it is a "short" invoice, Output() won't have a reference "inapplicable" variables -- GenericDetail2A, 2B, 3A, 3B won't be part of the data model returned in Output()
I access the column/page block by referencing the dynamic variable "GenericDetail1A entries", "GenericDetail1B entries", etc...
The snag is when a GenericDetail* value is not returned -- if referenced (ex: Select action), the flow will fail.
Workaround: Use coalesce() to default to an empty array if the "real" table isn't there. If there's a better way to deal with this situation I'd love to hear it!
Will there there always be 6 arrays?
The short answer is no. The model defines 6, but the result coming back from the Form Reader on any particular invoice will return only the ones that were "used". On a short bill with only a few charge lines, it will return GenericCharges1A but none of the rest in its "output()". But they are used in succession if there's a 3B there's a 3A, if there's a 3A there's a 2B and so forth
But what I'm trying to do is take those component clumps of data and reassemble them in the correct order to create a single list of the charges that I can then process -- identify header/footers, pluck off data elements like phone # from section head rows to apply to the detail lines.
What's in the arrays?
Embarrassingly simple.
[
{
"Charge Name": "nFO - Business Fiber Voice Service",
"Charge Amount": ".00"
},
{
"Charge Name": "Voice Service Charges for ### 363-####",
"Charge Amount": ""
},
{
"Charge Name": "Access Recovery Chrg-Multi Line Business",
"Charge Amount": "3.00"
},
{
"Charge Name": "CALL FWD BUS. **",
"Charge Amount": ".00"
},
{
"Charge Name": "CALL ID(BUS) **",
"Charge Amount": ".00"
},
{
"Charge Name": "INTERSTATE ACC CHG - BUS-MULTI",
"Charge Amount": "9.20"
},
{
"Charge Name": "FUSC MULTILINE **",
etc......
This raw array/table doesn't just contain the detail-level data, but also section header/footer data that will be processed out after all the component tables are reassembled and processed (for that I definitely need a For Each loop).
I think you've put me on the right track tho with "start with a string of array data, strip out [ ], then concatenate those results together as an array.