web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check whether a collec...
Power Apps
Answered

Check whether a collection contains a numberical value above a certain numberical value only if it occurs 3 times in a row

(0) ShareShare
ReportReport
Posted on by 8

I have an app which records fridge temperatures every 5 minutes. 

Twice a day, it pulls data from sharepoint and stores it in a collection before presenting it in a chart. 

It has 2 columns, Temperature and DateTime

I need to create an alert that sends an email only if the fridge has been out of range 3 (e.g. over 8 degrees) three times in a row. 

If the fridge is out of range for 10 minutes and then goes back in range and then out of range 10 minutes later. I do not want it to send an email. I only want it to send an email if it has been out of range 15 straight. 

I know how to configure the email but I don't know how to identify when the fridge has been out of range.

Is this possible with powerapps?

Categories:
I have the same question (0)
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @willtumus so when you say 'I have an app which records fridge temperatures every 5 minutes. ' what exactly is that app doing? Is it really an app or a flow?

     

    My first idea would be:

    Whenever your app records a temperature out of range you set a variable. Set(varCounter,varCounter + 1)

     

    Whenever the temperature is in range you reset the varCounter variable 

     

    Set(varCounter,0)

     

    Whenever the variable varCounter is equal to 3 you can send the email and reset the variable again 

     

     

  • willtumus Profile Picture
    8 on at

    Sorry I should have been more specfic. 

    Twice a day data for the last 24 hours is dumped into a sharepoint list. The list contains fridge temperatures at 5 minute intervals. 

    The app then uses this data dump to populate the app. 

    Your idea would be great if it was sequential data coming through. Is there a way it could work with a entire data set?

  • willtumus Profile Picture
    8 on at

    And to answer your first question. It's a powerapp 

  • Verified answer
    PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @willtumus if it is all about sending an email I would then recommend using power automate. 

     

    Use Get Items with a Filter query and Sort based on the capture date. Iterate thru the result with Apply for Each and use the same logic as mentioned above. This is much more reliable. Would this meet your requirements? Or is there any reason why you have to do this within the app?

  • willtumus Profile Picture
    8 on at

    Great idea thanks. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard