(I realize this forum has many similar threads; I've read them; I've read the documentation they link to; I'm still unsure how to do this).
I'm trying to write a Flow that scans through a Sharepoint folder, identifies PDFs, and move them into folders with corresponding names.
I've got:
1. Sharepoint List folder action
2. Apply to each on the Body from the previous action
3. Condition checking if the Name ends in ".pdf"
And that all seems to work correctly. I then want to have a sharepoint move action that uses an expression like replace(FILE_NAME_ATTRIBUTE, '.pdf', '') and I cannot figure out what the syntax needs to go in place of FILE_NAME_ATTRIBUTE. I tried triggerBody()?['Name'] and triggerBody()?['name'] which if I'm understanding any of this right doesn't work because triggerBody() is getting the entire result from the Sharepoint list folder rather than the subpart the current loop iteration is on, but I don't know where to go from there. In the GUI, as soon as I start an expression, the Name, DisplayName, Path, etc options vanish from the Dynamic Content list and the only option that remains is body.
Solved! Go to Solution.
Hi @gohanman,
Within a loop you can refer to an item() or item()['Name'].
So, in your setup could you try something like below:
replace(item()['Name'], '.pdf', '')
Hi @gohanman,
Within a loop you can refer to an item() or item()['Name'].
So, in your setup could you try something like below:
replace(item()['Name'], '.pdf', '')
Perfect, thanks!
User | Count |
---|---|
92 | |
44 | |
21 | |
17 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |