Good afternoon,
We have success fully made a flow that saves attachments sent to a specific address to a specific folder on our network. The only problem is that all attachments are saved, so also bits of the signature and other unwanted files. Ideally we only want to save *.pdf and *.xml files to the folder. I'm guessing it's a setting in the "apply to each" section but after selection any of the dynamic content i'm unable to set the parameters.
Hello @Anonymous
since item() represents one row for each Attachment you have to tell what property you would like to use. In your case it could be item()['name'] or something like that. You have to read the flow history or hover over your "Attachments Name" dynamic content to see what is really happening there.
About your test flow. If you use a filter array you also have to use the output of this filter array inside the apply to each "Select an output from previous step". Otherwise you will loop through all items again and filter array has no meaning.
Hello Matthy,
thanks for your reply. I tried using filter array with varying results.
When using the filter array in combination with "ends with" I get the following error:
The execution of template action 'Filter_array' failed: The evaluation of 'query' action 'where' expression '@endswith(item(), '.pdf')' failed: 'The template language function 'endswith' expects its first parameter to be of type string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#endswith for usage details.'.
So I made a new flow (see screenshot 1) with a new filter array "Attachments Name" is equal to file.log (for test purposes).
The flow doesnt give any errors but it still saves all the files to the folder in stead of just the file.log test file that was given in the filter array.
Any help would be much appreciated.
Hello @Anonymous
you should use filter array and after that you apply to each of this filtered items. You could check the name for „endswith“.
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional