cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Set variable if collection has empty record

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))



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

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

View solution in original post

1 REPLY 1
Drrickryp
Super User
Super User

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,063)