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

IsBlank First record

I need to set the DisplayMode property of a control based on if the first record in a collection is blank.

 

I can't use IsEmpty(CollectionName) because it's used in a gallery and always has a 'show saved' value in the first record, regardless if there is other data in that record.  It's a pseudo InfoPath repeating table.

 

I don't get any syntax errors with this but it also doesn't change the DisplayMode Property.

 

If(IsBlank(First(Markets.Region)), Disabled)

 

Any suggestions for using the 'First' function along with If and IsBlank to help set visibility or displaymode?



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
KroonOfficeSol
Resident Rockstar
Resident Rockstar

First(Markets.Region)

 

This part should be

First(Markets).Region

 

Because you want the first record of the Marjets list and a check on the Region Property, right. Rest of the if() formula you can get from the other answers.

 

But be aware that with this solution ordering the gallery will break your logic.

 

Hope this helps.

 

 

View solution in original post

6 REPLIES 6
Drrickryp
Super User
Super User

Hi @JR-BejeweledOne 

If(First(Filter(Markets,IsBlank(Region), DisplayMode.Disabled,DisplayMode.Edit)

in the DisplayMode property of the control, assuming Markets is the name of the collection. 

 

 

 

It doesn't like that.   Since First is being specified, indicating the first record in the collection, is filter really needed?



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.

Hi @JR-BejeweledOne 

If the collection is prefiltered and presorted, probably you are correct.  Could you provide a bit more information regarding the context in which you are using this information?

Digital
Super User
Super User

You could try using a Lookup to return the blank record then test if a column within that record is blank.

 

If(
    IsBlank(LookUp(Markets,IsBlank(Region),Region)), 
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

KroonOfficeSol
Resident Rockstar
Resident Rockstar

First(Markets.Region)

 

This part should be

First(Markets).Region

 

Because you want the first record of the Marjets list and a check on the Region Property, right. Rest of the if() formula you can get from the other answers.

 

But be aware that with this solution ordering the gallery will break your logic.

 

Hope this helps.

 

 

v-qiaqi-msft
Community Support
Community Support

Hi@JR-BejeweledOne,

 

Based on the issue you mentioned, you want to disable the button if the first record in your collection is blank.

Do you mean check if there is a field empty for the first record in your collection? You need to refer the first record to get the field value which is the goal to check if is blank.

On this premise, please modify your formula as below:

If(IsBlank(First(Markets).Region),DisplayMode.Disabled,DisplayMode.Edit)

 

Best Regards,

Qi Qiao

Best Regards,
Qi

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (1,602)