cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rabbanisyed
Helper V
Helper V

working with dataverse cards

Hi all,

I have a datacard and wanted to play with color of Datacardkey in my case it is (building#)

Rabbanisyed_0-1634220296763.png

in color property of Datacardkey my formula is below which throws error 

Switch(DataCardValue7.selected.value,"200",orange,"202",Green,"205",red)

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @Rabbanisyed,

 

The value is probably a different data type.

 

Can you try converting it into text and see if it works in the SelectionTagColor?:

Switch(Text(DataCardValue7.Selected.Value), "Low", Orange, "Medium", Green, "High", Red, Black)

 

View solution in original post

7 REPLIES 7
Expiscornovus
Super User
Super User

Hi @Rabbanisyed,

 

Is your Build number field of data type single line of text or a number?

 

When it is a number can you try something like below:

Switch(ThisItem.'Building Number', 200, Color.Orange, 202, Color.Green, 205, Color.Red, Color.Black)

 

thisitembuildingnumber.png

 

@Expiscornovus Thanks it works, i have a choice column and wanted to to change the color based on the priority

when selected low,medium,high i want the color to be different based on given formula i tried but no success

Switch(DataCardValue7.Selected.Value,"Low",Color.Orange, "Medium", Color.Green,"High",color.Red)

Rabbanisyed_0-1634281033512.png

Appreciated for you demo👍👍👍👍👍 

Expiscornovus
Super User
Super User

Hi @Rabbanisyed,

 

If you only want to style the text of the selected value you could use the SelectionTagColor property. You could use this formula in there:

Switch(DataCardValue4.Selected.Value, "Low", Color.Orange, "Medium", Color.Green, "High", Color.Red, Color.Black)

 

selectiontagcolor.png

@Expiscornovus still getting  error

i used the SelectionTagColor Property as said , what if i use the COLOR Property

Rabbanisyed_1-1634283428961.png

 

Rabbanisyed_0-1634283348665.png

 

I am using Dataverse Table with Choices control not the dropdown and dropdown control is not in the DV

Expiscornovus
Super User
Super User

Hi @Rabbanisyed,

 

The value is probably a different data type.

 

Can you try converting it into text and see if it works in the SelectionTagColor?:

Switch(Text(DataCardValue7.Selected.Value), "Low", Orange, "Medium", Green, "High", Red, Black)

 

View solution in original post

Great i use the color Property and got Thanks for the Help

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,777)