how to get the count using the Look up Records action

Efra Pruneda
Mega Guru

I have a flow in flow designer where I am trying to send an email to notify that the events coming from SolarWInds are lower than expected for the day before.

I have a trigger that runs the flow once a day at certain time

then I have a "look up records" action for the em_event table that looks for all records created yesterday where the source = SolarWInds but the count pill for this action is always returning a zero value. I wonder if you guys can help me find what I am doing wrong. here is a screenshot of the action in question. the usual count for an average day is a little over 40,000 records. so I am setting a condition to send an email if the count is less than 10000. with that in mind, can you advice the value I need for the max results field? I am not sure if I am using that correctly, I have it set to 10000. again the problem is when I run this flow, the count always comes back as zero.

find_real_file.png

the next action in my flow is an if statement that uses the count pill for the previous action followed by a send email action.

find_real_file.png

lastly, I am not sure how to finish the flow. do I need to put an action at the end of the flow to indicate the end or something like that?

I will deeply appreciate your help!

Efra

5 REPLIES 5

Geoff_T
Mega Sage

Hello,

If you setting max results at 10'000 and have a condition where Count is less than 10'000 then your if condition is never going to trigger assuming 10'000+ records are returned (and you say this is common).

Setting the if condition to less than 10'001 records in this scenario would trigger it.

Although if the logs are saying the count is 0 - there has to be an issue with your Lookup Records condition not pulling the data you are expecting. 

To answer your last question - you do not need an End action in this scenario, since it is always going to be the logical end of this flow.

Geoff, thank you for your time 🙂

here is a screenshot that shows that the em_event table had 39k records for yesterday. and yet the count pill on the look up records action is coming back as zero. I just changed the max results to 40000 but the count still comes back as zero. any ideas on what this is not working as expected?

find_real_file.png

It looks good to me. I notice the 'Order by' field is empty. It's worth selecting a value just to rule that out being the issue.

If I was facing this issue I would also try changing the query - something like Node is 10.15.124.142

We know this should return a result. If it does - it means there is an issue with your original query condition (even though it looks good).

Last thing I can think of - make sure in the flow properties it is running as 'System User'.