cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Timm1
Helper I
Helper I

How to have multiple checkbox datacards

Hi there!  I was able to convert a dropdown to checkboxes and was able to keep multiple checkbox entries by using a Gallery and changing some code. Works great.  I tired to do the same to the next datacard but there are conflicting results when I check from both places. I have a feeling it is the ForAll(ColCheckedArea) code that is messing it up. How can I have multiple datacards with checkbox Galleries?  Here is the code I used for the first one.

Gallery1 Checkbox-   

Oncheck-  Collect(colCheckedArea, {Title:ThisItem.Value})

OnUncheck-   RemoveIf(colCheckedArea, Title=ThisItem.Value)

In the dropdown item – DefaultSelectedItems -  ForAll(ColCheckedArea, {Value:Title})

I even changed the Title to Title2 on the second Gallery but that didn’t work. 

Please let me know if you need more info and thank you for your time.

2 REPLIES 2
RandyHayes
Super User III
Super User III

@Timm1 

Firstly, you are not dealing with a Dropdown if you have a DefaultSelectedItems, that is a Combobox.  And, with a combobox, your DefaultSelectedItems signature MUST match the record structure defined in the Items property.  So, I would first look at that.  If the Items property is not a table of single column rows with a column named Value, then nothing will match.  

If, for example, you have an Items property of ["a", "b", "c"] then you will have a single Value column table and you can set your DefaultSelectedItems to : RenameColumns(colCheckedArea, "Title", "Value")  (you don't really need ForAll to set your items).

But, if your Items property is more complex, then your DefaultSelectedItems needs to match that signature.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Thank you RandyHayes!  You are correct, it is a Combobox.  I will give your suggestion a try.  Thanks

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (73,858)