Hello everyone!
I am new user of Power Automate and I really need your help.
Every day I get a lot of Excel files. File name structure is "Validation result Company Error Date.xlsx"
I have a distribution list for each customer and each type of error
Customer Error Email
Customer1 | 01 | email1 |
Customer2 | Big Order | email2 |
Customer3 | C01 | email3 |
Customer4 | C10 | email4 |
Customer5 | no errors | email5 |
Customer6 | Q-ty error | email6 |
I have to send many emails depending on the name of the customer and the type of error
Letters with error type "01", "no errors" - must contain a link to the file (stored on the SharePoint)
Letters with error type "Big order" and "C01" - must contain an attachment.
Letters with error type "C10" and "Q-ty error" - must contain a table with data from the excel file in the body of the letter.
All files and Excel file with distribution list may be changed any moment. And I have to send emails as soon as new files are created on SharePoint.
I would be very grateful for your help! 😊
Hi
I really suggest doing the Learning Path (on Microsoft.com) for Power Apps. It will be super valuable.
App Maker learning catalog - Power Apps | Microsoft Learn
Get started with Power Apps canvas apps - Training | Microsoft Learn
Developer learning catalog - Power Apps | Microsoft Learn
Debugging canvas apps with Monitor - Power Apps | Microsoft Learn
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Hi Michael,
Thank you again!
Thanks for your advice, but I can't understand it😔. What do you mean "wrap your work in Error handling"? Where is it? And how? And what is "Monitor"? Where are such magic buttons? 😃
So glad I could help and more so that your stuff is working properly 🙂
Dont hesitate to open more questions if you need help.
One last thing, and I know In my examples I don't, but I always mention it, you should wrap your work in Error handling and then either reply to the Power App or Terminate to log success / failure 🙂 it will help with any debugging you need and make Monitor your best friend.
Hello Michael,
Thank you SO MUCH!!! Now my flow is working as I wish
Also, if and only if you use any of the variables in your Apply to each, make sure to set the concurrency to 1 in the configuration off the Apply to Each or you will get messed up resets. If you aren't using the variables that you created at the top IN the apply to each (anywhere) then you don't need to.
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Hello,
That is the part I talked about and is in my picture where you need to use the Create Table action and is my step 3 note to you above.
please review that and it will solve your issue.
Cheers
If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
Thank You
Michael Gernaey MCT | MCSE | Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
Hello Michael,
Thank you so much for your reply.
While I was waiting for any reply on my asking for help, I created a flow which allow to me create a lot of emails with correct links/attachments, correct email addresses, email text and other.
But I faced only one problem - I can't convert Excel files to Excel Table via Power Automate. It is required to create a table with the data in the body of email.
Hello,
This is actually a big ask. I started to actually write it up but showing you how to build it and get around whether you have a bunch of requirements not listed is not feasible and is very time consuming.
Here are the straight forward basics of what you need to do.
1. You need to use a Trigger for when a new file is added to a SharePoint document library
2. You need to have a folder that gets only the excel files you want to process, or you have a pattern that you can compare against the name when the Trigger files, so you know if you want or should process.
3. Once the file is determined to be processed you must do the following
a) List the rows in the sheet -- IMPORTANT NOTE the data has to be in a table so you either need to have it configured already, or you need to create one using the Create Table Action in power automate, giving it all the properties it needs to do its works
4) Right after the action that reads the data (again either via a script which has to already be in the file) or via List Rows, if it has a table, you need an Apply to Each. This is a loop that lets you access the output from a previous step.
5. For each row, you have to get the value of the columns you want to compare. In my opinion, you should have a CurrentErrorType, CurrentError, CurrentEmail variables. You would use these to do the following
-CurrentError (get the data from the current row in the loop)
-CurrentEmail(get the current email from the current row in the loop)
-CurrentErrorType. This is a little bit of simple magic. You said you have options of what to do depending on the error. And a switch is perfect for this. But you cab use a Number. So in the loop when you use the Value of the Set Variable action for CurrentErrorType to set it to 1,2,3,4,5 depending on how many different error processings you can do.
6. Add in the switch, setting each block equal to 1,2,3,4,5 whatever. In each block you would do the following
-Create an Email to send out
-Either Attach, Send Link, Whatever, but it would be different in each block.
I am sorry I don't have time to write the whole thing for you, but I am happy to help answer questions.
Here is a screen shot with some notes (you can see them written in an action header). The work isn't all that difficult if what you say is true, then the below (should add error handling too), is what you need.
Cheers
--------------------------------------------------------------------------------
If I had answered your question, please mark your post as Solved
If you like my post please give it a thumbs up
Thanks
Michael
https://gernaeysoftware.com
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional