cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
28GREKA
Frequent Visitor

MAKING SOME ACTION ACCORD TO AN ITEM IN A GALLERY WITH A BUTTON (ON SELECT) AND THE COLOR VALUE

Well, i have different galleries that works if the user wants to search some info by for example, status, date, id etc..

I haved this idea about using colors with the galleries items depends of the status.

ACCEPTED GREEN, REJECTED RED -- Something like that

On my filter of only status i did it with the property OnChange and it works perfectly:

 

If (DropEstatus.SelectedText.Value = "ACEPTADA" || DropEstatus.SelectedText.Value = "ACEPTADA PLAZO", Set(colorestatus, "#72D24E"));
If (DropEstatus.SelectedText.Value = "REGISTRADA", Set(colorestatus,"#D7A406"));
If (DropEstatus.SelectedText.Value = "RECHAZADA", Set(colorestatus,"#CA614C"));

 

28GREKA_1-1664553323723.png

 

28GREKA_0-1664553309055.png

So in my two labels, that are inside my gallery i put the valiable of the color in their Color property like this:

 

28GREKA_2-1664553458094.png

 

So.. when i want to do the same when the user wants to find a solicitude by ID it didn't work:

 

28GREKA_4-1664557069979.png

For example, in this case it has to be green not yellow... and i tried more options, even with another label outside the gallery and compare but nothing works...

I would appreciate your help.

 

Thank you! 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi !! Actually the Switch advice really helped me, it works:

28GREKA_0-1664562762489.png

I put the Switch condition inside of the property Color of my label 🙂

 

Thank you very much!

View solution in original post

8 REPLIES 8
Manan-Malhotra
Continued Contributor
Continued Contributor

Try using Drowdown.selected.value  instead of Drowdown.selectedText.value

Hi! Actually that was a mistake, because i'm using in this case the label in the condition: so the DropStatus.SelectedText.Value shouldn't be on the pic:

 

28GREKA_0-1664558484498.png

So, there is not a dropdown in this case... When i worked with the dropdown it worked perfectly, my problem is with the button and text input and this item inside my gallerie...

 

Thanks for answer.

 

You haven't closed the highlighted string

Sorry I guess its zoomed 

Yep, its the zoom! 🙂

Manan-Malhotra
Continued Contributor
Continued Contributor

 

Switch(LblEstatudID.Text,"ACEPTADA"||"ACEPTAFA PLAZO",Set(colorestatus2,#XXXXXX),"REGISTRADA",Set(.....),"RECHAZADA",Set(..))

 

Give this a go!

 

@28GREKA 

Please Accept as Solution if it solves your question Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/manan-malhotra-vfx/

Want to support me! Buy me a Cup of Coffee?

Thank you, technically it works but, in my case, i guess i need some delay or something because, when i make the first trial its okay, but then when i tried another one, it continues with the same color, and doesn´t take the instructions of change or switch:

28GREKA_0-1664561990503.png

For example here, it must be green, not red...

28GREKA_1-1664562043991.png

Switch(lblEstatusID.Text ="ACEPTADA"||"ACEPTAFA PLAZO",Set(colorestatus2,"#72D24E"),"REGISTRADA",Set (colorestatus2,"#D7A406"), "RECHAZADA", Set(colorestatus2,"#CA614C"));

 

I make it this way because with only "," at the beginning it marked an error....

Thanks again! 🙂



The comma in the beginning is important to follow according to the Switch syntax
If you got an error with comma, could you share that error?
We should try to resolve that error

Hi !! Actually the Switch advice really helped me, it works:

28GREKA_0-1664562762489.png

I put the Switch condition inside of the property Color of my label 🙂

 

Thank you very much!

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (4,695)