cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Davis_C
Frequent Visitor

Problem to generate email matching the attached file with result in database

Hello, I built the following flow, to interact with our onprem:

 

PA_Error_01.png

*Im aware of the error, see below

 

Which basically should do the following (each step of the flow is one number):

 

1-Run a stored procedure which extracts .pdf (sales quotation) files from blob table and saves on C:\Folder

2-Run a view which find the sales quotation numbers and the salesman email responsible for each quotation (last 48 hrs)

3-Move files from local C: drive to OneDrive

4-Check files just moved to OneDrive (specific folder)

5-Find files in folder, so I can use this variable on following steps

6-Apply to each (body) of the query, step 3

7-Apply to each (file name) of the step 5: Send an email with the file and the quotation number

 

*Here is where the problem begins.

In the picture above, the error says im not using an array (body), because I was trying to use each file name.

Im aware I must use "body", and I did, but then the emails are generated with un-related quotations, example:

eg. This is how it should be:

 

QuotationFilename
77.pdf
88.pdf
99.pdf
1010.pdf
1111.pdf

 

The quotation number, generated on the query at the 2nd step, should match the file found in the OneDriver folder.

Right now, Im receiving the emails like this:

 

QuotationFilename
710.pdf
89.pdf
911.pdf
107.pdf
118.pdf

 

They are out of order, the files are not matching the "Transaction_or_quote_number", which is the quotation number:

 

PA_Error_02.png

 

Please, need your help to match files with the quote number on each email.

Thanks for your help in advance.

2 REPLIES 2
Davis_C
Frequent Visitor

Just a quick update that I've tried to use a condition, where 'quotation' contains 'File name':

 

PA_Error_03.png

 

But the condition always have a 'false' result, meaning it couldnt find any quotation that contains file name.

Maybe I need to add some step here to properly get the quotation and file number to compare?

Davis_C
Frequent Visitor

Hello,

Im still trying to figure out this, its very important.

Will be very happy with any help to solve this flow.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,046)