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 / Specifying a value whe...
Power Apps
Answered

Specifying a value when a complex AddColumns result will be blank

(0) ShareShare
ReportReport
Posted on by 546 Super User 2024 Season 1

I have a collection that is being created that has a pretty convoluted search for an AddColumns statement (due to the use of a Sharepoint Person field:

ClearCollect(
 colWednesdayNight,
 AddColumns(
 'AES Global Portfolio',
 "Team Name",
 First(Filter(Search(AddColumns('Hot Add Controls',"DisplayName",Resource.DisplayName),
 'Executive Sponsor'.DisplayName,"DisplayName"),Title="Executive Sponsor")).Team
 )
)

The column addition is working properly, the only issue is that if the Executive Sponsor column has nobody listed in it, the search returns "Operations", which is the first team in the Hot Add Controls list that has the Title "Executive Sponsor".  If the Executive Sponsor field is empty, I'd like it to park a "N/A" in the Team Name field.

 

I've tried all kinds of combinations of If(!IsEmpty...) and If(!IsBlank...) but can't seem to figure out something that works.  

 

Would love some help!

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    How many items do you have in your list? The Not function <>  / isBlank / isEmpty are not delegable queries. Can you check if you are hitting delegation limits?

  • zuurg Profile Picture
    546 Super User 2024 Season 1 on at

    I'm not hitting delegation limits.  The Global Portfolio list has 263 records in it, the Hot Add Controls has 23 records in it.

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

     Are you checking this entire formula for IsBlank?

     

    If(IsBlank(First(Filter(Search(AddColumns('Hot Add Controls',"DisplayName",Resource.DisplayName),'Executive Sponsor'.DisplayName,"DisplayName"),Title="Executive Sponsor")).Team),'N/A') 

  • Verified answer
    zuurg Profile Picture
    546 Super User 2024 Season 1 on at

    I guess I must have been thinking about this issue in my sleep because I woke up at 4:00 with the solution: 

    My approach was wrong.  Originally, I was checking to see if the results of a search for an item I knew didn't exist was blank.  My new approach was: if the original field is blank, don't even bother doing the search and just fill it with "N/A" instead.

    Here's the new code:

    ClearCollect(
     colWednesdayNight,
     AddColumns(
     'AES Global Portfolio',
     "Team Name",
     If(!IsBlank('Executive Sponsor'),First(Filter(Search(AddColumns('Hot Add Controls',"DisplayName",Resource.DisplayName),
     'Executive Sponsor'.DisplayName,"DisplayName"),Title="Executive Sponsor")).Team,"N/A")
     )
    )

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard