cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Level 8

Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

What types of values can I put here?

I have a Table as a DataSource for my Gallery, with columns id, menuLabel and screen.

I want to set my Default to menuLabel=variable

I have tried this - not valid:

Default: {menuLabel:myVariableName}

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

Hi @stapes ,

Could you please share a bit more about the formula you typed within the Items property of the Gallery?

Do you want to set a Default value within your Gallery?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. Please consider set the Default property of the Gallery to following:

LookUp(
        "Type Gallery Items formula here",  // Replace here with actual formula typed within the Items property of your Gallery
         menuLabel = variable
)

If you want to highlight display current selected item in your Gallery, please consider set the TemplateFill property of the Gallery to following:

If(
   ThisItem.IsSelected,
   RGBA( 255, 228, 196, 1 ),
   RGBA(0, 0, 0, 0)
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

@stapes 

Would this work?

ThisItem.menuLabel

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

stapes
Level 8

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

Not really @mdevaney . ThisItem would refer to the item once selected.

ThisItem.MenuLabel is displayed as a Title in the Gallery rows,

Super User
Super User

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

Try LookUp(DataSource, menuLabel = variable) as the Default property of the gallery.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
stapes
Level 8

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

@PowerAddict- I tried this: LookUp(DataSource, menuLabel = "literal value"). This format gave error: Invalid Formula. Expected a value compatible with items.

Super User
Super User

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

And DataSource is the Items property of the gallery?
Highlighted
Super User
Super User

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

I am going to share an example here. Hopefully that will help you move forward: 

 

I have a gallery with the following values:

1. Items: Users

2. TemplateFill: If(Thisitem.IsSelected, Gray, White) (this selected the first record as the default)

3. Default: First(Filter(Users, 'Full Name' = "Akhil Mahajan"

 

At first nothing happened. I then changed the layout of the gallery, just to figure it out why the default property didn't change and then it worked! I am attaching a GIF that shows this working. 

 

GalleryDefault.gif

 

Let me know if this works. Also, to bring your gallery back to default, you should use the Reset(Gallery) function. 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

Community Support Team
Community Support Team

Re: Correct formats for Default property of a Gallery is not really explained in Documentation. How do I set it using a variable?

Hi @stapes ,

Could you please share a bit more about the formula you typed within the Items property of the Gallery?

Do you want to set a Default value within your Gallery?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. Please consider set the Default property of the Gallery to following:

LookUp(
        "Type Gallery Items formula here",  // Replace here with actual formula typed within the Items property of your Gallery
         menuLabel = variable
)

If you want to highlight display current selected item in your Gallery, please consider set the TemplateFill property of the Gallery to following:

If(
   ThisItem.IsSelected,
   RGBA( 255, 228, 196, 1 ),
   RGBA(0, 0, 0, 0)
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,261)