I plan to create a folder in the sharepoint for users to upload the files which the name of the file is already pre-fixed. I will also create a list in the sharepoint which the list contains all the files name I am expecting the users to upload the to the folder.
How do I set up the flow that each of the items in the list will look up to the file name in the folder and trigger the email to remind the user to upload if the file still not yet upload to the sharepoint folder?
Below is the list created with 3 files name
One of the file name has already been upload to the designated folder. so the flow will trigger to auto email to the other 2 emails which the files has not yet uploaded.
Appreciate for the coaching in advance.
Solved! Go to Solution.
@kelvin-lkh as discussed offline, i think we resolved your issue, following issues you had in flow:
1. Incorrect document library selected in Get Files
2. You were checking length of items returned by Get Items instead of check length of items returned by Get Files
@kelvin-lkh is this one time action or recurring. If recurring you can create scheduled flow, then add Get Items action to get items from List, loop through output of get items using apply to each action. Then add Get files (properties only), with filter query Name eq '<select filename from list item dynamic content>.xlsx', then in condition action check length of files returned by Get files, if its zero then the file with that name doesnt exists.
@kelvin-lkh please remove angle brackets <> from your filter query, i had just put it to show it as a placeholder. Also remove the words filter query from the filter query parameter value. It should be Name eq 'Current Item. xlsx' where current item is selected from dynamic content, i think you need to select the column name instead of Current Item.
@annajhaveri Thanks for your prompt reply. However, the test not successful after I have changes according to your previous comment. The failure due to the Name does not exist. The 'Name' should be the name of the files in the folder which are retrieve with the 'Get files' function. Just wonder what goes wrong again?
@kelvin-lkh i am sorry i gave you incorrect column name, please use FileLeafRef instead of Name in filter query
it is working after I use the FileLeafRef as column name. However, when it comes to condition, I receive all 3 items by email as 'submitted' but I am expecting 1 item as 'submitted' and 2 items 'not yet submitted' as I only create 1 file in the sharepoint out of 3 items in the list as shown below.
Can I know whether the issue is with the parameter under the condition set?
@kelvin-lkh instead of the value in left side of condition you need to use below expression:
@annajhaveri I have used the expression provided in the condition but the outcome are all the 3 items in the list the files have already submitted because the 'yes' condition doesn't satisfy.
is there anything wrong in my input shown below?
@kelvin-lkh you need to put the expression as shown in below screenshot, from Dynamic contents -> Expressions
@kelvin-lkh can you please expand the Get Files action in flow run and share the screenshot of it?
@annajhaveri Pls find below the get files action, Documents in sharepoint, Get item action and the backlog report list in sharepoint.
@kelvin-lkh thanks for screenshot. Sorry to ask again, can you please share the screenshot of the flow run with Get Files action. Same screenshot as below but with Get Files expanded:
@kelvin-lkh Okay so for 1st item there is a file that exists with that name in the list, so condition is resulting into false, which i think is correct. Can you check for other two items, in apply to each what is the result? To make it easier for time being, i suggest to add compose action above the condition action and add that length expressions that is used in condition in compose action, so that you know what length are you getting for all three items.
@annajhaveri Below is the result and the order of the compose I have added in. Not sure if I add the compose correctly and how does it tell why the flow doesn't product the outcome we are expecting?
@kelvin-lkh Compose action position looks correct, in your previous screenshot you had limit entries to folder Documents/Q1, do you need to do that, as your latest screenshot does not have it
@annajhaveri it still yield the same result even after I have put back the limit entries to folder Documents/Q1. What should I try next in order to find out what goes wrong with the flow?
@kelvin-lkh can you please take a look and share, what is the value in compose action after providing the folder in Get Files