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

Gallery Icon - Set visibility

Hi Guys,

I have a power app featuring a gallery with a collection as a source.

Each row on the gallery has some input boxes and 2 icons (icon_save and icon_success).

When a user presses icon_save, I would like to make the following changes:

icon_save.visible=false

icon_success.visible=true

I have tried adding this code to the icon_save 'on select' property but it does not work 🙄

1 ACCEPTED SOLUTION

Accepted Solutions
JimJim
Helper V
Helper V

Hi Guys,

I managed to work this one out, it was as simple as setting the icon's visibility property to: 

CountRows(Filter(ProductsCollection,ItemNo=dd_ItemNo.Selected.Result))>0

If the item existed in my collection it would show the success icon.

View solution in original post

7 REPLIES 7
RandyHayes
Super User
Super User

@JimJim 
You cannot directly set the properties of controls like that.  Just like cells with formulas in Excel derive their values from other cells, you need to put formulas on the Visible properties of your icons to determine their state.

I am not sure what your logic is for saving or success, but it would depend on how you are doing those functions.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes , Thank you, I did not know this.

I will rethink how I do this and post my solution here

RandyHayes
Super User
Super User

@JimJim 

Sounds good.  If you get stuck...post back with the issues.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I can't quite figure this one out, here is how my gallery is looking:

JimJim_0-1629470619755.png

The on select property of icon_save has the following code added to it

Set(v_itemno,ThisItem.ItemNo)

Then the visibility property of icon_success is set to 

v_itemno=ThisItem.ItemNo

This does not work at all 😩

RandyHayes
Super User
Super User

@JimJim 

Actually, you are on the right track!  

The only issue with that formula is that if the person then clicks on another save icon in another row, the original one that was not visible will become visible as well.

The other thing is that you are immediately setting the success icon visible at the click of the button...if the icon is to provide visual indication that it was a success...where is the check that it was actually a success?

 

What are you seeing happen with the current formula you have now?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

When the form first loads, I can't even see the save button

JimJim
Helper V
Helper V

Hi Guys,

I managed to work this one out, it was as simple as setting the icon's visibility property to: 

CountRows(Filter(ProductsCollection,ItemNo=dd_ItemNo.Selected.Result))>0

If the item existed in my collection it would show the success icon.

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 (6,024)