Hi all I am looking for some help in creating this one. I have all my attachments saving to a onedrive directory. Once they are in the directory my AI model goes over them and extracts details :-
Order number
customer number
customer name
purchase order
These are copied into a spreadsheet.
I want to create a flow to rename the files based on the entries in the spreadsheet and then move to another directory based on the file name
any ideas
thanks in advance
Hi Ferran
I have managed to get it to work, I have removed the compose function.
as you can see from the attached flow I was going about it slightly wrong
thank you for all your help on this
Hi @Wilson1981_
You have to write the expression inside the expression field, not as a string:
Hope it helps!
Ferran
Hi Ferran
Thanks for the help so far, i tried what you suggested and got the below error
The file id '/drives/b!RD417gNtGEeorMEn_7p0mQq2AhOZRX5Cufy3Oz9blylreIEqkfGkSo9En9jNknuD/root:/Cosworth/Attachments/0009008849_866_SO_4533471.pdf' is not valid.
Here is the flow i have put together on this
Have i missed something obvious on this
Thanks
Will
Hello @Wilson1981_
You can get the path of the onedrive folder using the following expression:
last(split(triggerOutputs()?['headers']['x-ms-file-path'],'root:/'))
So you would have something like this (be careful with the "/"):
Hope it helps!
Ferran
Hi Ferran
Thanks for the help on this ,y flow looks like this
But when I run it it gives me this error
The destination '/drives/b!RD417gNtGEeorMEn_7p0mQq2AhOZRX5Cufy3Oz9blylreIEqkfGkSo9En9jNknuD/root:/Cosworth/Attachments/0009008849_866_SO_453347.pdf' cannot be a file.
I thought it would just overwrite this or do i need to change it to the folder location
thanks in advance
Will
Hello @Wilson1981_
On what depends the directory name where you want to move the file? Have a look at this example:
The steps are:
1) List all files in OneDrive
2) For each element, chech if it's a file
3) If it's a file, pass its content to AI Builder
4) Use the output of the previous step to define the file name (compose action).
5) Move or rename the file to the desired location and with the specified file name.
Hope it helps!
Ferran
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1