I am creating a test request system based in sharepoint list where I want a unique test ID that resets every year. The test ID will look something like PTL22-250, where "PTL" is a constant string, 22 (2022) is the year of the creation item in the list, and 250 is the 250th request in 2022. I currently have a solution where I grab all items from my list with the get items field, initialize a variable to find the year of the current timestamp, and do an if statement to see if the created field in my list item starts with the year variable. (Created field returns a string of the form "yyyy-mm-dd-hh-mm-ss" or something close, I know it starts with yyyy.
This is a very long way to do it, I was wondering if there was a more robust method. I would love to be able to use the ODATA filter on get items to return only the values that start with the year variable I made, but it just won't work. Here is my error message below. Any ideas on how to make this work? I just want to return items that were created in the same year as my flow run.
Hi @GStanisic12 ,
Take the output from sharepoint without a filter query and filter it in the next step using a filter array in advance mode like this:
Change the item()?['Date'] to the column where you have the date. So you probably only have to replace the date in ['Date'].
@equals(formatDateTime(item()?['Date'], 'yyyy'), formatDateTime(utcNow(), 'yyyy'))
Let me know how it goes 😄
{ If my post answered your question, please Accept it as a solution ✔ }
{ This will in turn help others find solutions to similar questions }
Best Regards
Heartholme
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
27 | |
26 | |
23 | |
14 | |
10 |
User | Count |
---|---|
63 | |
55 | |
29 | |
28 | |
24 |