Hello,
I am having a flow to read multiple files from folder in OneDrive and update the data in SharePoint.
But flow picks up the files which were already updated in SP every time it runs. (As expected )
Is there anyway to control the flow to pick up only the new files added or only the files modified recently in folder? I know this is possible to do if my files are in Share Point Library with status column.
But not sure how I can do the same for the files in OneDrive folder.
Thanks
HI @grantjenkins ,
Thank you , It worked to pick up the latest files modified in last 24 hours.
But I am unable to assign the content of excel file to share point item list inside the loop , Properties from "List rows present in table" are not visible to map in "Create Item" List.
But when I used "List files in Folder" from one drive instead of " Get files Property" this problem is not there.(As below )
Update : I managed to figure out how to get current item with simple expression for each column when creating the item in share point list like below . But i really wonder how it works with one drive but not using Get file property.
You can use the SharePoint connector Get files (properties only) since OneDrive is essentially SharePoint behind the scenes with regards to file storage. You can use any of the SharePoint connectors for OneDrive.
For Site Address you will need to paste your OneDrive URL as a Custom value.
For your Library Name you will need to type Documents as a Custom value (Documents is your My files).
For Limit Entries to Folder, you can navigate to your OneDrive folder.
For Include Nested Items, select Yes.
For Filter Query paste in the following expression.
//FSObjType eq 0 means only return files (not folders)
//The Modified part will return files that were modified in the last 24 hours only
FSObjType eq 0 and Modified gt '@{addDays(utcNow(), -1)}'
.
You can then loop over each of the files, or create an HTML table to send via email, etc.
----------------------------------------------------------------------
If I've answered your question, please mark the post as Solved.
If you like my response, please consider giving it a Thumbs Up.
Does the next topic help you?
Good luck
Hi @OkanAT ,
Yes indeed, its helpful.
But my flow is schedule to run every day at the end of business hours. In a day, there will be many files modified and new files created. So I do not want to clutter the flow as the flow will contain email alert step too . Hence I would need to run once a day.
Thanks
Thanks.
Hi,
You can start the flow with the trigger "When a file is created" by Onedrive. So whenever a file is added to the folder, your flow will trigger only for that file. So this will pick up all new files added to onedrive..
Then >
You could copy this flow, and replace the trigger with the onedrive action "when a file is modified"
Hope this helps.
Good luck.
Good luck.