Hello,
I am trying to create a trigger condition for use on SharePoint's "When an item is created or modified" trigger but can't get it working.
The condition I want to test is if the date in a SharePoint list text column is equal to the date in the SharePoint's default Modified column.
Here is trigger condition I am trying: @equals(triggerBody()?['tiered'],triggerBody()?['Modified'])
Tiered is a text field in a SharePoint list and its value is set in a Power App using Text(Now(),ShortDateTime).
The SharePoint list Modified column is set to use the Standard Display Format.
When I view the list the columns match but the trigger condition doesn't seem to ever evaluate to true.
So, I created to variables in my flow and set the values to using the Dynamic content values from the trigger:
and I get
So, it appears that although they look the same when viewing the list, the values are actually different.
I'm guessing I might need to format them so they look the same (I'll take any suggestions on how to do that) or perhaps I need to change my Tiered SharePoint column from text to date.
Can anyone please steer me in the right direction?
Thanks,
robertg
Solved! Go to Solution.
I ended up determining the difference between the two dates and times. But rather than do this in a trigger condition I just added a condition inside the Flow. So if the time difference was 2 or less I sent the email, otherwise did nothing.
This is the code to determine the difference:
Hi @rgentile
Not sure why the modified not showing the date only format?
If you looking only the date to compare then you could do the following
Above I have two compose and formatDateTime() expressions. Following are the expressions I used.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks for the reply and the code @abm. Is there a way to add time to the date when I compare them? I need to make sure the date and time match.
I was thinking perhaps my problem was related to the tier being a text field so thanks for confirming my thought that it could be part of the problem. I appreciate your time and help.
robertg
I tried changing the Tiered column to a date format and the formats match. But I see there is a bit of a time difference so I think it would always return false.
I'm thinking of trying to to determine if the times are within say a minute of each other rather than equal. Sound reasonable?
Thanks
I ended up determining the difference between the two dates and times. But rather than do this in a trigger condition I just added a condition inside the Flow. So if the time difference was 2 or less I sent the email, otherwise did nothing.
This is the code to determine the difference:
Hi @rgentile
Yes thats the milli seconds difference. So if you want to ignore then use the format yyyy-MM-dd hh:mm:ss
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThe 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 |
---|---|
67 | |
60 | |
29 | |
27 | |
25 |