cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cnorris135
Helper IV
Helper IV

Gallery Field Capture issue

Trying to understand something...... i have a checkbox field called "ClassChoices" in a Gallery.   This checkbox field has 5 checkboxes in the gallery.  Along with capturing the first and last name from the form, I am trying to capture all the values in the checkbox(gallery) into a collection.  My code looks like this:

 

Collect(
           {ClassMember: Concatenate(

                         DataCardValue2.Text,
                         "",

                         DataCardValue3.Text),

            ClassSelected: ClassChoices.Value})

 

the text fields work in the collection, but i get nothing from the checked boxes.  I also tried ClassChoices.Text and nothing works.  What am i doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cnorris135 ,

Are you trying to collect multiple selected items? Firstly I am assuming that ClassesSelected is a Boolean (yes/no) field in your list - it so, try this

Clear(ClassRequestList);				
ForAll(
   Filter(
      YourGalleryName.AllItems,
      ClassChoices.Value = true
   ),
   Collect(
      ClassRequestList,
      {
         ClassMember: 
         Concatenate(
            DataCardValue2.Text,
            "",
            DataCardValue3.Text
         ),
         ClassesSelected: true
      }
   )
)

 

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.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @cnorris135 ,

Firstly, you have no Collection name. I just did a test this end on the below and it collected the selected item in the gallery with two text boxes and a checkbox perfectly on 5 runs in a row.

Collect(
  YourCollectionName,
  {
      ClassMember: 
      Concatenate(
         DataCardValue2.Text,"",DataCardValue3.Text
      ),
      ClassSelected: ClassChoices.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.

 

Yes i forgot to put that in the code.... the code is this:

Collect(

    ClassRequestList,

    {

        ClassMember: Concatenate(

            DataCardValue2.Text,

            "",

            DataCardValue3.Text

        ),

        ClassesSelected: ClassChoices.Value

    }

)

 

I have this on a button called "Add Member" on the OnSelect and I get this..
selectedList screenie.PNG

So i gets the Name just fine, but i can not get the checkbox captures.  I selected 3 checkboxes in the gallery so it should show 3 items...  Sigh........

Hi @cnorris135 ,

Is this what you expect ?

Collect(
     YourCollectionName,
     {
         ClassMember:
             Concatenate(
            DataCardValue2.Text,"",DataCardValue3.Text
             ),
          ClassSelected: Concat(Gallery.AllItems,lbl_Classes&" - "&CheckBox.Value&";")
   }
)

I supose that you have a label inside the gallery that keeps the Classes name and I included in Concat function(). I called lbl_Classes, you can adapted as your needs.

Your ClassSelected will be a string type, including all combobox values from Gallery.

 

Hope it helps !

No sir, im sorry it is not.  My Gallery called "ClassGallery" only has the checkbox field in it called "ClassChoices".  I was thinking the WarrenBelz idea would work of ClassChoices.Value, but for whatever reason, it leaves the ClassChoices in the collection Blank...... i selected three items in the gallery.  Just does not make sense to me why it wont work.

Hi @cnorris135 ,

Are you trying to collect multiple selected items? Firstly I am assuming that ClassesSelected is a Boolean (yes/no) field in your list - it so, try this

Clear(ClassRequestList);				
ForAll(
   Filter(
      YourGalleryName.AllItems,
      ClassChoices.Value = true
   ),
   Collect(
      ClassRequestList,
      {
         ClassMember: 
         Concatenate(
            DataCardValue2.Text,
            "",
            DataCardValue3.Text
         ),
         ClassesSelected: true
      }
   )
)

 

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.

Hi @cnorris135 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Yes sir, that worked.  i always appreciate your help.  It worked.   Thank you.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (5,040)