cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shell1
New Member

How to pull two gallery options into a single Form field

Hi all

 

I've read through a good few forums on this topic but not seen a query that matches my scenario.

 

The app records employee hours against the organisation and project that organisation is funding. Users select this at the moment by a gallery which is filteted by a dropdown (listing the org), and a search function (users start to type in the project (this was easier as there are so many)). 

 

The selected item from the gallery then displays in a Form. Underneath,  users then input their hours, and the Form is submitted using a Defaults/Patch/Update function in a button. This works lovely.

 

Users then requested a "favourites" gallery as they will work on 4 or 5 projects at one time, so it will save them time repeatedly searching for the same projects. Fair enough. 

 

I have created a collection, which patches through to an excel table which logs the users favourite, which they select from the gallery. This works, no issues. 

 

The favourites gallery is displayed using varcontext to show it when they user clicks a "show my favourites " button. This can just overlay the previous gallery which showed everything.

 

What I cannot understand how to do is then, if the user is viewing their favourites gallery, rather than the main gallery which shows all project, how I can set the Form to show either the entry when selected in the main gallery, OR, the entry selected in the favourites gallery.

 

I've got round it a very clumsy way by duplicating screens and setting the "show favourites" button to basically navigate to another screen which only shows the favourites gallery,  but I know this is clumsy and will slow the app down. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

You can also modify the items formula in your gallery in a similar fashion.  This would eliminate the need for 2 galleries.  

 

In your gallery Items property, do this:

 

Switch(
   varcontext,
    "value 1", 
    Formula for main gallery items here,

     "value 2",
     Formula for favorites gallery items here
)


If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

2 REPLIES 2
JR-BejeweledOne
Super User
Super User

As long as your form is not referencing a different data source, you should be able to do this:   In the Item property of your form:

 

 

Switch(
   varcontext,
    "value 1",
   GalleryMain.Selected,
    "Value 2",
   GalleryFavorites.Selected
)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
JR-BejeweledOne
Super User
Super User

You can also modify the items formula in your gallery in a similar fashion.  This would eliminate the need for 2 galleries.  

 

In your gallery Items property, do this:

 

Switch(
   varcontext,
    "value 1", 
    Formula for main gallery items here,

     "value 2",
     Formula for favorites gallery items here
)


If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,256)