cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shaneOZ Responsive Resident
Responsive Resident

Counting Rows of list if today

Hi,

 

Im trying to create a flow to count rows if the date is today, however it is how working this is my flow and below that is the test run, could someone please advise?

 

flowsss.pngflowsss2.pngflowww1.pngflowww2.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Counting Rows of list if today

Hi @shaneOZ ,

 

Could you share more details on your scenario?

 

My understanding is that you would like to get items that date is equal to Today, then update another corresponding list item with the amount of returned items from the original list.

 

In your flow configuration, in Filter query field of action Get items, please make sure the Todaysdate has the same format with current time, otherwise, you need to format the Current time so that it has the same format with Todaysdate.

 

I have made the following test for your reference.

 

The function used in the Filter Query field is:

Date1 ea 'formatDateTime(body('Current_time'),'yyyy-MM-dd')'

Function used in the Compose action is:

length(body('Get_items')?['value'])

 

Then update the returned results in another list.

1.PNG

 

Best regards,

Mabel

 

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

2 REPLIES 2
Dual Super User
Dual Super User

Re: Counting Rows of list if today

Hey, 

 

In the post you mentioned that you want to count for the current day so this count starts at 1 every day right? 

 

If so, in the set variable action under the for each loop, set the value of the "Current count" variable to "1" and then run the flow. You should be able to get the counts then. 

 

Edit: Please refer to the screenshot: (Setting the value everytime in the loop will not give the correct results)

SSSS.png

 

 

Thanks, 

 

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!

Community Support
Community Support

Re: Counting Rows of list if today

Hi @shaneOZ ,

 

Could you share more details on your scenario?

 

My understanding is that you would like to get items that date is equal to Today, then update another corresponding list item with the amount of returned items from the original list.

 

In your flow configuration, in Filter query field of action Get items, please make sure the Todaysdate has the same format with current time, otherwise, you need to format the Current time so that it has the same format with Todaysdate.

 

I have made the following test for your reference.

 

The function used in the Filter Query field is:

Date1 ea 'formatDateTime(body('Current_time'),'yyyy-MM-dd')'

Function used in the Compose action is:

length(body('Get_items')?['value'])

 

Then update the returned results in another list.

1.PNG

 

Best regards,

Mabel

 

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

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,144)