cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
G-E-0
Helper I
Helper I

How i can change the fill color with ThisItem.Color???

Hello,

I need help to change fill color.

I want to change the color inside the fill of Circle in gallery. 

I have write 

Switch(ThisItem.ColorDropDown,"Red",Red,"Blue",Blue,"Green",Green,"Yellow",Yellow,"Orange",Orange,"Brown",Brown)

but it didn't work.

The type of Color is choices in data.

I trie and this 

Switch(ThisItem.ColorDropDown.Value,"Red",Red,"Blue",Blue,"Green",Green,"Yellow",Yellow,"Orange",Orange,"Brown",Brown)

but again is wrong.

I need your help.

Thank You!!!

Sorry for my English language.

12 REPLIES 12
Himanshu_90677
Super User
Super User

If(
Dropdown3.Selected.Value = "red",Red,
Dropdown3.Selected.Value = "yellow", Yellow,
Dropdown3.Selected.Value = "pink", Pink,
Dropdown3.Selected.Value = "black", Black,
Dropdown3.Selected.Value = "white", White
)

ansrikanth
Resolver III
Resolver III

@G-E-0 

 

Can you try this ??

Switch(ThisItem.ColorDropDown.SelectedText.Value,"Red",Red,"Blue",Blue,"Green",Green,"Yellow",Yellow,"Orange",Orange,"Brown",Brown)

If it doesn't work, Can you share what is your data source for colordropdown?

 

Thank you

-Srikanth

I have attach screenshots how my data is like 

Himanshu_90677
Super User
Super User

Like this?

IMG20220315175727 (2).jpg

G-E-0
Helper I
Helper I

CollorError.png

 

ColorType.png

 

ProjectColors.png

 

ansrikanth
Resolver III
Resolver III

That formula I showed in my previous post is working for me.. here are the screenshots

here is my dropdown items..

ansrikanth_2-1647347717620.png

 

here is the formula.. the only difference is my dropdown is not in a collection, which shouldn't make any difference.. 

ansrikanth_1-1647347679322.png

 

Did it worked for you?

Thank you

-Srikanth

 

G-E-0
Helper I
Helper I

ColorDropdown is just the name from one column in database.ProjectColors2.png

Himanshu_90677
Super User
Super User

Fill =

Switch(ColorDropdown.Selected.Value,"Red",Red,"Blue",Blue,"Green",Green,"Yellow",Yellow,"Orange",Orange,"Brown",Brown)

Working in my gallary

On my app isn't work because i have two pages for this color. In one page i can change the color and on other page i want to show the color from all projects. Each Project have different color. The dropdown who i change  color is not on the same page who i show the color.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,916)