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

Checkbox default from one gallery to another.

Hi, I have two gallery with the same data source. Here is my scenario.

Gallery1 and gallery2 have same data source "ColJobFamily.crfa8_jobfamilyid". I am trying to solve a situation

when I am selecting the checbox in gallery1, it should automatically select the respective checkbox in gallery2 since the items property is same in both the gallery.

 

Can someone help on this please?

 

the "more" label has onselect property "Set(ShowDailog,true);" which is displaying gallery2. 

Checkbox text property = ThisItem.JobFamilyID

 

 

P_SA_0-1629945405834.png

 

9 REPLIES 9
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @P_SA  

 

In the gallery 2 Default you can check Thisitem.yourColumnName=Gallery1.Selected.yourColumnName ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

P_SA
Helper V
Helper V

this works only if a single item is selected. what if I select mutiple checkboxes? please help.

HI @P_SA ,

What are the Items of both galleries (in Text please) and have you got any code on the OnCheck and OnUncheck of the checkboxes?

P_SA
Helper V
Helper V

Hi @WarrenBelz  here is the items property in  both galleries.

 

Items : ColJobFamily.crfa8_jobfamilyid

 

below are the properties of checkbox,

 

text : " ThisItem.JobFamilyID"

 

Oncheck :   Collect(colCheckedJF,{JFID : ThisItem.JobFamilyID})

Uncheck : Remove(colCheckedJF,LookUp(colCheckedJF,JFID = ThisItem.JobFamilyID))

P_SA
Helper V
Helper V

@RandyHayes  Hello , can you please help me with a solution ?

 

Many thanks

Hi @P_SA ,

The code

Collect(
   colCheckedJF,
   {JFID : ThisItem.JobFamilyID}
)

will certainly add a new item to your collection which has one field JVID

The OnUncheck would probably be better as 

RemoveIf(
   colCheckedJF,
   JFID = ThisItem.JobFamilyID
)

but that is not the issue - are you saying that the second gallery which has colCheckedJF as the Items does not show the new item added?

P_SA
Helper V
Helper V

Hi @WarrenBelz  Apologies if my post was not understandable. What I am trying to achieve is.

"when I am selecting the checbox in gallery1, it should automatically select the respective checkbox in gallery2, the items property is same in both the gallery."

Example , In below image 1, if I select checkbox = Finance , it should also select the checkbox in image2 where checbox = Finance.

 

P_SA_0-1629945405834.png

P_SA
Helper V
Helper V

@v-siky-msft  hi can you please help here?

Hi @P_SA ,

You need something else on the checkboxes - I assume these are true/false fields. Is the field name behind the check boxes (the Default value) JFID? On the Check and OnUnCheck put

Patch(
   colCheckedJF,
   ThisItem,   
   {JFID : Self.Value}
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,460)