New power user here. I have only made one other flow and it was much simpler than this is proving to be.
I am trying to create a flow so that when a file is uploaded to the "Client Invoices" folder, the file that was uploaded is attached to an email and sent to a specific client. The names of the files that are being saved to the "Client Invoices" folder are autogenerated from QuickBooks and they look like this "QBSE_RBI_Solar_Inc_Invoice_601.pdf", or "QBSE_RBI_Structures_Invoice_706.pdf". So, if the file name has "Solar" it needs to go to firstname.lastname@example.org and if it has "Structures" it needs to go to email@example.com. The email subject needs to be "LeanGo Invoice ### PDF Copy" The numbers are listed in the title of the file as well.
I saw another post that I was following and trying to copy but it's not exactly what I need and they use a "LineBreak" which when I searched for it didn't exist.
They achieved their result using a SharePoint list so I went ahead and created a list and here is what it looks like.
I also want to make this flow so I can easily edit this as we add new clients. I am stumped by this flow and would really appreciate any and all help or to learn if my idea is even possible (I think it is). Also sorry for not embedding the image, it kept giving me errors.
Thanks in advance,
@zbishh2 you need to create a flow which uses "When a file is created (properties only)" trigger, select the sharepoint site, library and folder in the trigger parameters.
Then add Get Items actions to get items from Clients list. Then add filter array action to determine which File Tag from the list matches with the current file name, configure the filter array action as below
In the From parameter select value (List of items) from Dynamic Content -> Get Items
Then use below expressions from Dynamic content -> Expression
right side use below expression from Dynamic content -> Expression
Then you can add compose action and configure below expression to get Email Recipients
To attach the file to Email do following
1. Add "Get file content using path" action and configure it as per below screenshot
2. Add Send email action and in attachments section, select file name (from trigger) for attachments name parameter and select File Content (from get file content) for attachments content parameter, as shown in below screenshot
Then add Send Email action and use output of compose action in the To parameter.
I tried your flow all the way through and I am getting an error at the compose step.
Everything above this is configured as you said. Here is the configuration of the compose step that is failing.
@zbishh2 sorry i think the instructions i gave in the last response were a little messed up as i had not actually tested those steps, so i updated the instructions, you need to change the trigger and filter array action and compose action expressions, so please read my previous response again and configure your flow accordingly.
When I try to do the step after compose, which is "Get file content using path" it switches the action to "apply to each" and puts get file content using path inside of apply to each as shown in this screenshot.
I found a work around by creating a folder for each client and doing a simple
"When a file is created in a folder"->
"Get File Content" ->
"Send an email"
I think using your solution would still be better as it would set me up for less upkeep work in the future. It is up to you if you want to continue to try to solve this for me.
Thank you so much for you help. This was a very warm welcome since this was my first post on the community board. Looking forward to learning more about the power platform.
@zbishh2 from your screenshot it looks like you are using the path from the Dynamic Content - Get Items property, but you need to select the Full Path from Dynamic Content -> Trigger property
You need to use the full path as highlighted in below screenshot
Check out the News & Announcements to learn more.
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.