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 / Display disabled AAD a...
Power Apps
Answered

Display disabled AAD accounts in a different colour in a Power App form multiselect people field

(0) ShareShare
ReportReport
Posted on by 49

Hi PowerApps experts!

 

I am working with a form in PowerApps which contains a people picker field which contains multiple "System Admins".  This is a people picker field working with my SharePoint List. If one of the people who has been picked as a System Admin against my SharePoint list's item should leave the company, and their AAD account is disabled, I'd like to be able to highlight this by displaying their name in a different colour.

 

My idea is to create for the "Color" property of the DataCardValue some syntax that checks the AAD account status. In an ideal world only the name of the disabled account from the multiple accounts displayed in the field would show as a different colour, but I would accept a solution that at least highlights all the names in a different colour where at least one account is no longer active, as I suspect that's realistically the only possibility that can be achieved.

 

I tested a syntax that seems to work fine against a people column in SharePoint that is single select only - it displays the name of the system admin in red text if the account is disabled and in black text if the account is enabled:

 

If(Office365Users.UserProfile(ThisItem.'System Admins'.Email).AccountEnabled = false, RGBA(255, 0, 0, 1), RGBA(0, 0, 0, 1))

 

 However, in the instance the 'System Admins' column in SharePoint and the associated PowerApps form is multi select, this no longer works.

Does anyone know if this is possible to achieve somehow? I really appreciate any input / suggestions.

Many thanks!

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @dw909 ,

     

    How do you want to display 'System Admins' that allows multiple selections? What controls are used to display these System Admins? Can you provide some specific descriptions or screenshots?

     

    In addition, most controls cannot individually color parts of the text.

     

    Best Regards,

    Bof

  • dw909 Profile Picture
    49 on at

    I can't provide specific screen shots because of personal data related to these fields.

     

    Effectively I have a gallery for browsing records on the left side of my app and there's a Form on the right side of the app. The form defaults to View mode and then can be edited in Edit mode. All I wanted to do was have the text for the System Admins a different colour in view mode, where one of the selected System Admins has a de-activated account. I'm ok with the fact that all system admin names will be in the same colour text as a limitation.

  • Verified answer
    dw909 Profile Picture
    49 on at

    I have managed to find an answer to my own problem - at least as good as I think is technically possible.

     

    The 'System Admins" field in the Form in my app is DataCardValue81

    For the Color property I have written:

    If(Office365Users.UserProfile(DataCardValue81.Selected.Email).AccountEnabled = false, Color.Red, Color.Black)

    Additionally I created a warning icon against the field with visible property:

    If(Office365Users.UserProfile(DataCardValue81.Selected.Email).AccountEnabled = false, true,false)

    This icon also has a Tooltip to explain the warning.

     

    It would have been nice to just have the text of the disabled account in red text, rather than everyone's name in the field being red text, but I believe that bit is not possible.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard