cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JatinSaini
Helper II
Helper II

Conditional Visibility on Gallery Icon based on other Collection

Hi Experts,
Thanks in Advance for the response & support.

JatinSaini_0-1661420696980.png

 

This might be different as I described but let me explain the scenario:

Left Side-

It's my gallery which display records from a sharepoint table in form of cards.

The Source Filed consist of Icons (Phone,Email,Chat,Support,Print)

 

Right SIde-

It's my Form Control which at top has another checkbox whithin a gallery.

The Checkboxes are same like - Phone, Email, Chat....

 

I want to visible only those icons on my left gallery which are checked on the right side form control for that specific record.

 

I hope this explains the scenario in better way.

PLEASE HELP

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

So instead of having all icons and have their visibity turn on and off, you have a gallery of icons. Though, instead of having the source of the child-gallery be a different collection, you can use the value of the multi-select choice field:

 

ChildGallery.items = ThisItem.TicketSource.Value

 

Then, instead of the visibility, you can have a single icon in the gallery and adjust the icon property:

 

If(ThisItem.Value="phone",Icon.Phone,ThisItem.Value="mail",Icon.Mail,Icon.Message)

View solution in original post

6 REPLIES 6
Mike2500
Super User
Super User

What is the data source for the checkboxes? Are these yes/no fields in SharePoint? If so, you could simply set the visibility property of each, such as:

 

PhoneIcon.Visible = ThisItem.PhoneField

 

In the above code, PhoneIcon is the name of the icon in the gallery, and PhoneField is the name of the yes/no field in the sharepoint list. 

JatinSaini
Helper II
Helper II

Hi @Mike2500 
The Data Source for the checkboxes in the SP List is a Multi-Select Choices.

Ok, so you have a mutli-select choice field with values of Phone,Email,Chat,Support,Print. 

 

If the name of the field in sharepoint is "TicketSource", set the visible property of the Phone icon to:

 

"Phone" in ThisItem.TicketSource.Value

 

Then, just repeat with the others:

 

"Email" in ThisItem.TicketSource.Value

 

etc.

JatinSaini
Helper II
Helper II

Hi @Mike2500 ,

Thanks for the response.

Since, It's just the learning phase of my powerapps journey.
Let me help you with the exact scenario:

 

I am developing a SP List Form into an App using powerapps.

The app is something like I have posted in the first post.

Left Side is Gallery to show the list of items from SP List in form of cards.

Right Side is the Form Control itself.

 

Now the first column(Filed) of the SP List is 'Source' which is multi select choice type having values - Phone,Email,Chat,SSP,FAX. But I have converted the multi select choices dropdown into a Checkbox by inserting gallery. The selected checkboxes are getting stored in a collection 'colSourceData' and getting passed to the Source Column in SP List.

 

Now coming to the left side gallery(Data Source=SP List Form) I want the Source Column Values from the SP List to display in form of Icons.

For this I tried to insert another gallery(Name=Icons Gallery,Data Source=collection of icons named 'colIcons') within this gallery which contains Icon.
NOw I want to filter only those Icons from the 'colIcons' which are there in the SP List Source Column

 

I could explain this better if you could connect with me via teamviewer and I'll share the screen, only If you are interested in investing time in it.
Rest, any help would be appreciated from Experts like you.

So instead of having all icons and have their visibity turn on and off, you have a gallery of icons. Though, instead of having the source of the child-gallery be a different collection, you can use the value of the multi-select choice field:

 

ChildGallery.items = ThisItem.TicketSource.Value

 

Then, instead of the visibility, you can have a single icon in the gallery and adjust the icon property:

 

If(ThisItem.Value="phone",Icon.Phone,ThisItem.Value="mail",Icon.Mail,Icon.Message)

JatinSaini
Helper II
Helper II

Hi @Mike2500 
FANTASTIC.
THAT REALLY WORKED.

IT WAS QUITE SIMPLE APPROACH. 

Am thinking that why didn't I had this idea, but I Guess that's the only difference between a newbie & Expert.

Hale Mike. ❤️

 

 

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 (3,615)