cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MJKjoachim
Level: Powered On

Checkbox default property set from multicolumns collection

Hello,

 

For a checkbox in a gallery, I am facing some difficulties to set correctly the property "Default".

 

Until now, the property was set from collection with 1 column like this :

ThisItem in SelectedCountry

Some days ago, I discovered how to use collection with more than 1 column but I cannot find the correct writing to set the same property.

For the moment, I stopped at this state :

ThisItem in SelectedFilter.Country

Below, screenshot of the checkboxes.

image.png

 

 

 

 

 

 

 

 

Anyone have the solution ?

 

Thx in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Checkbox default property set from multicolumns collection

Hi @MJKjoachim,

I'm not clear on what exactly happens after you check the boxes but it should be possible to use the Set() function to create a global variable that depends upon a selection in the Collection when you Navigate back to the original screen. IE. 

Back(); If(SomeCondition=true, Set(gvar, true), Set(gvar, false)

and make toggle's Default property:  gvar

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Checkbox default property set from multicolumns collection

Hi @MJKjoachim,

example2.PNGI may be mistaken but it looks like you want to filter a gallery by selecting one or more of the items in it. However, It is not clear what you are looking to do after selecting the items. If you just want to filter a datasource by selections from one of the fields, in this case country, I believe that it would be easier to use either a combobox control to do that and to filter the datasource based on the selections in the combobox.  In the figure on the right,  the Items property of the combobox is

 Sort(Distinct(Orders,City),Result)

This formula produces a single column table of unique cities with Result being the field name sorted alphabetically. The DisplayFields and SearchFields properties are ["Result"].

The Items property of the Datatable (you could use a gallery instead), is 

Filter(Orders,City in ComboBox1.SelectedItems.Result)

The datatable shows all of the orders that were made coming from Chicago and Boise.  

 

MJKjoachim
Level: Powered On

Re: Checkbox default property set from multicolumns collection

Hello Drrickryp,

 

Thank you for your answer !

 

My problem is slighty different, let's me explain more in details.

 

I have in Screen A  where a gallery lists all my customer.

In screen A, I have a toggle button used as filter on/off.

When activated, we navigate to another screen B where 2 galleries of filter is shown.

Gallery B1 is listing the country of customer (with distinct function)

Gallery B2 is listing the type of customer (with distinct function)

 

For each B1 and B2, when checkbox is selected, it feed a common collection with 2 columns (country, type).

 

When the customer have checked country/type , he can validate it with a button which automatically navigate to Screen A where the gallery if filtered according what is filled in the collections filter.

 

My problem now is when the customer come back to filter screen to modify the selection, I would like throug the "default" parameter of checkbox to have it checked/unchecked depending the collection.

 

I am 99% sure it is possible to do it, but I cannot find the right way how to write the formula.

 

I hope with my explenation, the problem is more clear now.

Thank you in advance fore your help !

TopShelf-MSFT
Level 10

Re: Checkbox default property set from multicolumns collection

Hi @MJKjoachim thank you for your post and sorry to hear you're experiencing these difficulties. 

 

@Drrickryp thank you for your initial response. Could you review the new information provided?

 

@TopShelf-MSFT

Super User
Super User

Re: Checkbox default property set from multicolumns collection

Hi @MJKjoachim,

I'm not clear on what exactly happens after you check the boxes but it should be possible to use the Set() function to create a global variable that depends upon a selection in the Collection when you Navigate back to the original screen. IE. 

Back(); If(SomeCondition=true, Set(gvar, true), Set(gvar, false)

and make toggle's Default property:  gvar

View solution in original post

TopShelf-MSFT
Level 10

Re: Checkbox default property set from multicolumns collection

Thanks for your help with this thread @Drrickryp@MJKjoachim can you advise if you have solved your problem?

 

@TopShelf-MSFT

Highlighted
MJKjoachim
Level: Powered On

Re: Checkbox default property set from multicolumns collection

Hello everyone,

 

I apoligize for my late answer, the start of this year is quite tough at the office !

 

First, thank you for your help.

I knew already about the set function, it can help in this case.

 

By the way, in the meantime, I changed a little bit the design of my "filter screen" in order user could select different filter type (i.e. country, type, name...) so I had to adapt (and I am still modifiying) the code.

 

If I still need help when my code will be more finished, I will post a new message in this thread.

 

Thank you again and have a nice day !

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,527)