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 / IsBlank First record
Power Apps
Answered

IsBlank First record

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

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?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    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. 

     

     

     

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    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 Profile Picture
    1,207 on at

    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
    )

     

  • Verified answer
    KroonOfficeSol Profile Picture
    587 on at

    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@microsoft.com Profile Picture
    Microsoft Employee on at

    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

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard