hi there,
I was wondering if you guys can help me figure it out. I am stuck.
I'm trying to create a flow that will do the following:
When a file is created or modified in a document library, insert a date in a list column.
So say I have a LIST called TestList and it has the following columns:
First Name, Last Name, Gender, Date, UniqueID (which is a calculated field that concatenates the first 3 columns)
First Name | Last Name | Choice | Filedate | UniqueID |
John | Smith | R1A | John_Smith_R1A | |
Jane | Doe | V2A | Jane_Doe_V2A |
And then I have a DOCUMENT LIBRARY called TestLib which is where pdf files that are named exactly like the UniqueId on the list are saved (no metadata, just filenames). So the library will contain:
John_Smith_R1A.pdf
Jane_Doe_V2A.pdf
I need it so that every time a matching filename is placed in the library, the flow will run and put a date on the "FileDate" field of the matching list item.
Date is ideally the modified date. Also, only update ones with no dates so if a date exists then don't update it.
I tried to create this flow:
But in "Get Item" I can't get the "UniqueID" field. It is only showing me "ID" to pick from.
Can someone please help?
Thank you so much in advance,
CS
I just so this topic was marked as solved, so I guess it was you that followied the instructions and overcame the challenge. Thax for your kindness, and Happy Flowing!
Hi!
I would try to add a 'get items' instead, and filter those whose UniqueID matches your current file name without extension.
You can filter by means of an ODATA expression inside 'Get items' or by a 'Filter array' action block.
Let's assume you implement it by means of an ODATA expression, so it will be easier:
So your 'Get items' output will be an array, ideally you will get either 0 or 1 elements inside. You can evaluate its length by means of one or more Condition action blocks and act accordingly, the trick is to evaluate 'Get items' outputs length by means of the following WDL expression:
length(body('Get_items')?['value'])
If you are unfamiliar with ODATA expressions, please check this great article:
https://sharepains.com/2018/11/12/sharepoint-get-items-odata-filter-query/
If you are unfamiliar with WDL expressions please check here:
https://flow.microsoft.com/en-us/blog/use-expressions-in-actions/
Hope this helps
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional