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 / Conditonal Formatting ...
Power Apps
Answered

Conditonal Formatting based on button text

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

I have a Choice column in Dataverse (5 Status) which I would like to conditional format in Power apps based on the value

 

I have made a button in a canvas app and set the text property to 

 

 

Text(ThisItem.'5 Status')

 

 

and set the Fill property of the button to

 

 

If(
 ThisItem.5 Status.Value="Passed",
 Green,
 ThisItem.5 Status.Value="Failed",
 DarkRed,
 ThisItem.5 Status.Value="In-Progress",
 GoldenRod,
 ThisItem.5 Status.Value="Not Started",
 Gray
)

 

 

 

However I keep getting a 'Scope' error and 'Text' error?

 

Any help appreciated 

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

    @AshleyTaylor 

    Please try the following,

    If(
     ThisItem.5 Status.Value='yourChoiceColumn (yourTable)'.Passed,
     Green,
     ThisItem.5 Status.Value='yourChoiceColumn (yourTable)'.Failed,
     DarkRed,
     ThisItem.5 Status.Value='yourChoiceColumn (yourTable)'.In-Progress,
     GoldenRod,
     ThisItem.5 Status.Value='yourChoiceColumn (yourTable)'.'Not Started',
     Gray
    )

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • AshleyTaylor Profile Picture
    on at

    Thanks for your suggestion unfortunately can you eleloborate on 

    yourChoiceColumn (yourTable)

    The choice column in my table is called called '5 Status' and the Choice is called 'Status Choice'

    My Table is 'cr95e_5c 1s'

     

    Thanks for any help

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @AshleyTaylor 

     Replace yourChoiceColumn with '5 Status' and yourTable with 'cr95e_5c 1s'

     

    As you type it intellisense will show you that.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • AshleyTaylor Profile Picture
    on at

    Sorry sScreenshot 2023-12-20 152818.jpgtill facing issues with this 

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @AshleyTaylor If it is a Global Choice, you could just use,

    'Status Choice'.Completed etc.,

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • AshleyTaylor Profile Picture
    on at

    I am unable to get this working with the IF function however, I have tried using SWITCH and that works on the first condition,

    Switch(
     ThisItem.'5C Status',
     'Status Choice'.Completed,
     Color.Green
    )

    but If I try and add any more condiitons, intellisense does not work and the formula does not function at all.

     

    witch(
     ThisItem.'5C Status',
     'Status Choice'.Completed,
     Color.Green
    ),
     'Status Choice'.Open,
     Color.Blue
    )

     

    Any assistance would be much appreciated  

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @AshleyTaylor The Switch statement has only one closing bracket in the end. Remove the other ones.

     

    Please remember to give a 👍 and accept my solution as it will help others in the future.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 316 Most Valuable Professional

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard