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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard