cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ammarfassy
Helper III
Helper III

retrieve records created only for the current month

Dears,

 

I am using GetItems action to retrieve records from a sharepoint list.

 

There is a requirement for me to filter only the records created on the current month.

 

how can i create my filter condition (ODATA) ?

 

thanks in advance,

Ammar

1 ACCEPTED SOLUTION

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @ammarfassy,

 

To filter only the record created on the current month, you could try to use the function startOfMonth and startOfDay.

 

The function I used is:

1.PNG

 

The first expression is defined as:

startOfMonth(getPastTime(0,'MONTH'))

The second expression is defined as:

startOfDay(utcNow())

Note: each expression should be surrounded by a single quote.

 

More details about the function, please check the following doc:

Workflow definition language

 

Please take try with it on your side.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @ammarfassy,

 

To filter only the record created on the current month, you could try to use the function startOfMonth and startOfDay.

 

The function I used is:

1.PNG

 

The first expression is defined as:

startOfMonth(getPastTime(0,'MONTH'))

The second expression is defined as:

startOfDay(utcNow())

Note: each expression should be surrounded by a single quote.

 

More details about the function, please check the following doc:

Workflow definition language

 

Please take try with it on your side.

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

thanks a lot Mabel. (y)

Dears,

 

currently i am expereincing an issue on this excel export.

 

I do have records from 1st November to 26th November (SharePoint List).  The generated report contains only the records from 4th November to 26th November (Extracted File). 

 

the forumula wihch i used is as below:

 

ActivityDate ge '@{startOfMonth(getPastTime(0,'MONTH'))}' and ActivityDate le '@{startOfDay(utcNow())}'

 

33333.png

then i tried with all these options:

 

  • ActivityDate ge '@{startOfMonth(utcNow())}' and ActivityDate le '@{startOfDay(utcNow())}'
  • ActivityDate ge '@{startOfMonth(formatDateTime(utcnow(),'yyyy-MM-dd'))}' and ActivityDate le '@{startOfDay(utcNow())}'

but didnt work.

 

I coudnt find what is the issue here.

 

please kindly advise,

thanks,

Ammar

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,664)