Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

How to get 'Created' date into 10 chars then use that output in a condition testing list records to see if created date is seven days back

Posted on by 113

Hi,  I have a 'Created' date I need to have that formatted to ten characters to use in a comparison test see if it is seven days back.  In the Get Items 'query filter' I can't find an option to format 'Created' to ten characters for a valid test against addDays (seven days back using 10 characters). 

 

And why don't I see 'Add Dynamic Content' is another question - on another post it was suggested that option went away. 

 

landsend_0-1661539134595.png

 

I've tried just checking 'Director Approval' eq null then in another step format the 'Created' field entry then test but with no success.  Maybe its the flow not sure. Here was a next attempt.

landsend_1-1661539591520.pnglandsend_2-1661539625827.pnglandsend_3-1661539933535.pnglandsend_4-1661539973099.pnglandsend_5-1661540001037.png

 

 

 

  • David- Profile Picture
    David- 1,256 on at
    Re: How to get 'Created' date into 10 chars then use that output in a condition testing list records to see if created date is seven days back

    You would use the expression formatDateTime(outputs('Get_item')?['body/Created'],'yyyy-MM-dd')

     

    The red text could be different depending on the action where you are getting the output of the Created value.

  • landsend Profile Picture
    landsend 113 on at
    Re: How to get 'Created' date into 10 chars then use that output in a condition testing list records to see if created date is seven days back

    Hi,  Appreciate the update on the ISO requirement for Dates and Times.  That I found in output your suggestion did put the '-'  dashes in the date to check against.  I am still posed with how to get a long date format for 'created' into that same format.   The create date format is long length and the comparison I'm working with is 10 characters and the comparison is I believe failing on that mismatch.  I've tried to get the create date formated to 10 characters but don't think that newly formatted object is being picked up and used as the field to compare with and the question. Thanks. 

  • David- Profile Picture
    David- 1,256 on at
    Re: How to get 'Created' date into 10 chars then use that output in a condition testing list records to see if created date is seven days back

    I think the only problem is with your filter query. You need to format the date as 'yyyy-MM-dd' rather than 'yyyy.MM.dd' as Power Automate uses the ISO 8610 format for this. See What is ISO 8601? Proper Notation of Dates and Times Using ISO 8601 - ISO Update for details.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,651

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,727

Leaderboard

Featured topics