Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Verified answer
    CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Conditonal Formatting based on button text

    @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.

  • AshleyTaylor Profile Picture
    on at
    Re: Conditonal Formatting based on button text

    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  

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Conditonal Formatting based on button text

    @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
    Re: Conditonal Formatting based on button text

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

  • CNT Profile Picture
    10,919 Super User 2025 Season 1 on at
    Re: Conditonal Formatting based on button text

    @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
    Re: Conditonal Formatting based on button text

    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,919 Super User 2025 Season 1 on at
    Re: Conditonal Formatting based on button text

    @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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,594 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard