
Announcements
Ok so I think I understand how the template for extracting information from invoices works. The problem for me is I want specific lines and their totals. I'm trying to isolate extraneous charges and just looking at the base charges. In this specific example I want the time and distance by itself, the base rate.
If you look at the receipt it has two lines of "Time & Distance" and I want those added up and then create a "line" in SharePoint. I created an AI that extracts a majority of the information I need. Subtotal and Total included.
The problem is that Time & Distance is dynamic and there can be more than one entry on the receipt based on the pricing structure of the company. I've got my AI builder to get the information as seen below but now I want to extract just the Time and Distance, sum it to get the total Time and Distance and then subtract it from the SUBTOTAL to get the base rate.
Above are the current items I have extracted from my AI builder.
Below you'll see what I'm trying to do. I'm trying to extract the base rate (time and distance) so I can subtract it from the SUBTOTAL so I can isolate and report the extraneous charges.
Any help would be greatly appreciated.
Thanks!
Daniel
It looks like you want AI to detect all occurrences of "TIME AND DISTANCE" in the charge detail and add those up.
And it looks like all the variables you've defined are string fields.
If you're trying to glean off and sum the amounts for detail lines where one or more has Description "TIME AND DISTANCE", you will need to define a new variable of type Table, and provide column names of Description, Quantity, Period, Rate, Amount. (These will all be captured as strings, even Amount -- we'll deal with that shortly.)
Once you've defined the table as a variable, then Next to your Collections and select the Charge Detail table on each form in your collection(s).
a. circle the whole table, excluding headings and total line
b. mouseclick to identify each row
c. Mark off columns by ctl-leftclick
d. You'll be left with column headers labeled A, B, C.... click each header and choose the appropriate name from the popup list of column headers that will appear.
This will require a little more work on your Flow end.
Let's say you named your AI table "Charge Details", In your flow, the value you're looking for is from the AI return set is Charge Details Entries.
And another helpful hint, unlike referencing Sharepoint return sets, you don't reference AI tables as "item()?['ColumName']. You'll need to reference them using the "friendly" name they give you in the Variables list. So if you were looking for Amount in the table "Charge Details" you would be looking for the variable called "Charge Details Amount value" to use in assignments like in Select actions.
Once you've Select'd the table from the AI return data, it can be handled/ref'd like any other array.
So once you've taken the Table, done a Select to pull the columns you want, you can then to a Filter Array where Description = "TIME AND DISTANCE"
I wish I could include some screencaps to illustrate but my Cloud Flow editor has suddenly gone wonky. Locks up action blocks with a red exclamation point when I try to select a variable to apply. Grrf!
Hope this helps. Working with AI Forms Builder is a steep learning curve esp dealing with the return result set, but once you get your bearings on that it does get easier and less overwhelming. Hang in there!