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

Check if Gallery Item was selected

I have built a gallery with a list of screen names and want to make an icon visible if the user has selected the screen.

I have created variables, for instance, to confirm that the user has selected the gallery item (see table below).  By default, the variables are set to false.  I want the variable to change to true once the gallery has been selected.  

I have the condition already on the gallery select value as 

 

If( Gallery.Selected.Value = A, Navigate('A'),

Gallery.Selected.Value = B, Navigate('B'), ....)

 

I want to know is it possible to building into the condition also to change the variable value?  Example: If( Gallery.Selected.Value = A, Navigate('A'); Set(A, true).

 

Or should I be going about it another way? 

 

Screen NameVariable
ASet(A, false)
BSet(B, false)
CSet(C, false)
DSet(D, false)

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Super User
Super User

@duncant  A better way to do it may be to have the Data Source for the Gallery as a collection with the Screen Name and a screenViewed flag (defaults as false). When the user selects a particular item, you can navigate and also Patch the screenViewed flag to true for that item. This way you won't end up having to declare more and more variables if the number of screens increase.

View solution in original post

5 REPLIES 5
CNT
Super User
Super User

@duncant u can do that. If u explain the reason behind it, maybe v can find a better way to do it.

@CNT I want to check to see if the user has selected the gallery item to verify the user has reviewed the data they have inputted from the selected screen. 

CNT
Super User
Super User

@duncant  A better way to do it may be to have the Data Source for the Gallery as a collection with the Screen Name and a screenViewed flag (defaults as false). When the user selects a particular item, you can navigate and also Patch the screenViewed flag to true for that item. This way you won't end up having to declare more and more variables if the number of screens increase.

casperbr
Frequent Visitor

Can you maybe explain in more detail how this works?

How to convert a Collection item can be converted to a screen

duncant
Helper V
Helper V

It' more so, changing the property.  But what are you looking to do?

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,326)