cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JabbarCRM
Helper II
Helper II

To fetch all records that were created on yesterday

Hey Dear People,

Hope you all are well, By the way I had requirement to create report which will run on weekdays only wherein Monday's report will contain entity's records that were created on Friday and Tuesday's report will contain entity's records that were created on Monday and so on so till now what I have done is that I have created a schedule flow which run on Weekdays from Monday to Friday on specific time.

So I am obtaining Today's date using DateTime connector and getting the Yesterday's date using same connector.

 

The thing is that I am not able to obtain the records based on CreatedOn field when I check CreatedOn with equals operator but as soon as I check it with less than or greater than operator then suddenly it fetches all the records that is fine. (You can see to attached pictures)

In my case I want to obtain the records that were created yesterday or on specific date...….!!

(Note: this entity was created in CDS also I have tried with other connector i.e Dynamics 365 however getting same result)
Please do help me...

 

1.JPG3.JPG4.JPG5.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @JabbarCRM ,

 

Please try to use the following expression to filter records:

formatDateTime(body('Get_past_time'),'yyyy-MM-ddT00:00:00Z')
utcNow('yyyy-MM-ddT00:00:00Z')

Image reference:

137.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
abm
Super User
Super User

Hi @JabbarCRM 

 

The reason for the equal operator not working is due to Date & Time.

 

Why can't you format the date with 'yyyy-MM-dd' format and compare?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Hey @abm ,
Thanks for your response however i had already tried however as you said then i did lot for today's date as well .... Same issue is going on.

Could you please create a simple flow by adding mobile button and then create a variable and include utcNow() or yesterday's date and then try to obtain list of records using eq operator from your side.

It works for lt, le, gt, ge but not for eq.

I have already done using condition operator i.e if else however i had same result.🙄

Hi @JabbarCRM 

 

Try the below format

 

formatDateTime(utcNow(),'yyyy-MM-ddT00:00:00Z')
 
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
v-bacao-msft
Community Support
Community Support

 

Hi @JabbarCRM ,

 

Please try to use the following expression to filter records:

formatDateTime(body('Get_past_time'),'yyyy-MM-ddT00:00:00Z')
utcNow('yyyy-MM-ddT00:00:00Z')

Image reference:

137.PNG

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hey @v-bacao-msft ,

 

I would like to say thank you for helping me out and I am very much glad to hear from you.

😊👏

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,113)