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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (1,410)