cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

Count the number of records in the sharepoint list within a day

Hi, is there a way to count the number of records in the sharepoint list within a day?
I have 100 items in the list but I tried this filter query in sharepoint "Get Items", it keeps return me 99 items.
Any advise? Thanks!
issueDate ge '@{formatDateTime(utcNow(), 'yyyy-MM-ddT00:00:00Z')}' and issueDate le '@{formatDateTime(utcNow(), 'yyyy-MM-ddT23:59:59Z')}'

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Count the number of records in the sharepoint list within a day

Hi @sbgoh ,

 

Take a try with expression below with my provided flow:

formatDateTime(addHours(item()?['issueDate'],8),'yyyy-MM-dd')

or

formatDateTime(addHours(item()?['issueDate'],-8),'yyyy-MM-dd')

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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

12 REPLIES 12
Highlighted
Resident Rockstar
Resident Rockstar

Re: Count the number of records in the sharepoint list within a day

@sbgoh In the Get items, you can add a Filter Query.

 

Created ge '2020-08-28'

 

CFernandes_1-1598601100279.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Highlighted
Helper V
Helper V

Re: Count the number of records in the sharepoint list within a day

Hi @CFernandes, it only return 1 record for me.

Highlighted
Resident Rockstar
Resident Rockstar

Re: Count the number of records in the sharepoint list within a day

@sbgoh For testing purpose, try using another another date.

 

Another option would be to use the REST API.

 

CFernandes_0-1598605142388.png

 

/_api/web/lists/getbytitle('FirstNameLastName')/items?$select=ID,Created&$filter=Created%20ge%20%272020-08-28%27

 

Try to do some Trial Error at your end.

 

I hope you it helps you investigate further. 

 

 

 

 

 

Highlighted
Helper V
Helper V

Re: Count the number of records in the sharepoint list within a day

There is timezone issue but I am unable to solve it. My issueDate is a date time field.

Highlighted
Resident Rockstar
Resident Rockstar

Re: Count the number of records in the sharepoint list within a day

@sbgoh 

 

Set the Time Zone in SharePoint Online and the use the REST API approach that I suggested you in my previous update.

 

  1. Open the SharePoint site on which you want to change the Time Zone.
  2. On the Site Actions menu, choose Site Settings.
  3. On the Site Settings page, under Site Administration, choose Regional settings.
  4. On the Regional Settings page, select the Time Zone that you want for this site, and then choose the OK button.
Highlighted
Community Support
Community Support

Re: Count the number of records in the sharepoint list within a day

Hi @sbgoh ,

 

You could refer to screenshot below to create the flow(Please leave the filter query field in the get items action blank):

1.png

 

The first expression in the Filter array action:

formatDateTime(item()?['issueDate'],'yyyy-MM-dd')

 

The second expression in the Filter array action:

formatDateTime(utcNow(),'yyyy-MM-dd')

 

The expression in the Compose for the number:

length(body('Filter_array'))

 

 

 

Best Regards,

Alice

 

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

Highlighted
Helper V
Helper V

Re: Count the number of records in the sharepoint list within a day

I think my problem is related to time zone because for that 100 records that I created in the morning, I only able to get the count of 1 if I run the flow again in the evening. I still don't have a solution yet.

Highlighted
Community Support
Community Support

Re: Count the number of records in the sharepoint list within a day

Hi @sbgoh ,

 

What is your local time zone?

You may take a try to add/sub some hours to meet the UTC time.

 

Best Regards,

Alice

 

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

 

 

 

 

 

Highlighted
Helper V
Helper V

Re: Count the number of records in the sharepoint list within a day

Hi Alice, it is Malaysia.

Highlighted
Community Support
Community Support

Re: Count the number of records in the sharepoint list within a day

Hi @sbgoh ,

 

How many hours does the local time quickly or slow than  the UTC?

 

Best Regards,

Alice

 

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

Highlighted
Helper V
Helper V

Re: Count the number of records in the sharepoint list within a day

I think is 8 hrs.

Highlighted
Community Support
Community Support

Re: Count the number of records in the sharepoint list within a day

Hi @sbgoh ,

 

Take a try with expression below with my provided flow:

formatDateTime(addHours(item()?['issueDate'],8),'yyyy-MM-dd')

or

formatDateTime(addHours(item()?['issueDate'],-8),'yyyy-MM-dd')

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,595)