Hi, New to flow and hitting a snag with the new conditions.
I set up a flow based on the standard template for saving an email attachment which worked fine. I tried ot implement a condition such that it sends pdfs to one folder and all other file types to an "image" folder. Something seems to be off about it as it's still saving both files to the pdf folder. I have it setup as such:
Anyone have an idea for how to get the attachments appropriately split up?
Solved! Go to Solution.
Hi @unionj ,
I created a testflow and I think this meets your request:
What I did in the file content part of the create file action is to put this in the expression:
items('Apply_to_each')?['ContentBytes']
Can you create a compose action with the attachments variable in it. Then run the flow and check for the outcome of the compose. There you can check if its really ending with .pdf. I think it's not a string but an object that you can't check like this.
Thanks for the response. I followed the method noted here: Flow that saves different email attachments to different SharePoint folders. I've been able to get it to recognize individual attachments, i.e. when there is 1 PDF attachment it goes to the PDF folder; if there is 1 PNG attachment it goes to the IMAGE folder. So i think the step is reading the "attachments name" variable right.
However, when there are 2 different attachments (one PDF and one OTHER), it's sending both of them to the YES flow. In the YES route, I am only able to reference the "Attachments" variable in the field "Select and output from previous steps". Is it possible to split that so it only pulls in the relevant PDF attachment?
The only other option it gives me it "Current item", but that fails.
Hi @unionj ,
I created a testflow and I think this meets your request:
What I did in the file content part of the create file action is to put this in the expression:
items('Apply_to_each')?['ContentBytes']
Thanks! I was able to get it to work based on what you setup. However, I needed to change the condition back to
Attachment Name 'ends with' .pdf
When I did the Attachment 'equal to' application/pdf, it would not identify the pdf correctly and it would send both to the IMAGES file.
I had to restart the "If yes" path from scratch. It actually had multiple steps and was requiring an input of "Attachments". Once I redid it with "Compose" it didn't ask for it anymore.
What does "Compose" do?
EDIT: @dvdalen , I also had to change the "File Content" back to "Attachments Content". Using the "items" method you suggested created a file that wasn't viewable. Once changed to "Attachments Content" it appears to only apply it to the correct file.
Thanks!
Good to know
User | Count |
---|---|
85 | |
71 | |
44 | |
26 | |
25 |
User | Count |
---|---|
42 | |
25 | |
23 | |
23 | |
17 |