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
@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.
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
@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.
Sorry still facing issues with this
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.
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
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.
WarrenBelz
146,594
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional