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 / Set variable if collec...
Power Apps
Answered

Set variable if collection has empty record

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

In working a collection/gallery, I need to be able to set a variable if an item is deleted but the collection still has a blank row. (InfoPath style repeating table)

 

Scenario:  Warning is displayed if there is a blank row before the user can move to the next screen.    This is to prevent blank rows from being patched to SharePoint.

 

When a record, populated or the blank row, is removed from the collection (Remove.ThisItem), the collection needs to be evaluated to determine if there is still a blank row and set the variable accordingly.  This way if a populated record has been removed the blank row warning is still visible, but if the blank row has been deleted, then the warning is no longer visible.

 

I have tried all of these and none evaluate correctly.   All set the variable to 'false' regardless if there is an empty row in the collection.

 

If(Markets, (!IsBlank(Region), Set(varBlankRow, false)

If(!IsBlank(Markets.Region), Set(varBlankRow, false)

If(!IsBlank(Last(Markets.Region)), Set(varBlankRow, false))

Categories:
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @JR-BejeweledOne 

    Please see the screenshot below.  Formula for the button is below.  It sets a warning notification and sets the global variable.Annotation 2020-06-03 090357.png

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard