Get the Count of records in Flow or Power Automate – Dynamics 365 CE

Hi Everyone,

Today I got a requirement to check the record count and do some operation if the count is greater than 1. We are very much used to these kind of checks in C# and just think if we need to the same in Flow.

Here is the way to do. We just need to know one expression for doing it.

I have a following Action of List Records from CDS connector and renamed it to ListOfAccounts.

Declared an Integer variable and below the expression used for setting the value.

length(body(‘ListOfAccounts’)?[‘value’])

Once we run the flow, the variable will have the count of accounts that are retrieved by List Records action. We can use same expression in conditions.

Hope this helps.


Happy 365’ing
Gopinath.

One thought on “Get the Count of records in Flow or Power Automate – Dynamics 365 CE

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s