Hello,
Am working on building an invoice processing model. While creating different collections, I came across some invoices where there is no line number on the invoice. My model is reading the information on an invoice uploaded on SharePoint and exports the information into a CSV file on SharePoint.
The Invoice line number is one of the primary keys in the table where I am trying to insert the data into, so if it is not available on the invoice, I need to generate it automatically. So, I thought of creating an integer variable and increment it every time the Invoice processing solution would detect a line in the table on the invoice. The variable is incremented successfully. However, when the data is inserted into a CSV file, it keeps the last value of the variable. For example , if there were 4 lines on the invoice , the invoice line number on the invoice gets inserted as 4 for all lines instead of 1,2,3,4.
I did not want to rewrite the whole flow - so in Power Automate, I have created a separate loop to deal with the invoice number issue. That's why in my screenshots, you will see 2 'Create CSV table'.
Am attaching some screenshots to help with the problem description.
Can you please help me ?
Thank you
Shadiya