web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / gallery with checkboxe...
Power Apps
Unanswered

gallery with checkboxes not saving

(0) ShareShare
ReportReport
Posted on by 525

Hi All,

 

I've a single line of text in backend. and I'm trying to concatenate & patch the checkbox selections into the column. Below is my formula, not sure where I'm going wrong, the values weren't saving at all.

 

ForAll(
 Gallery1.AllItems As X,
 With(
 {
 cakeName: X.Label2.Text,
 ingredients: Concat(
 Filter(
 Gallery3.AllItems As Z,
 Checkbox2.Value
 ),
 Checkbox2.Text & ";"
 )
 },
 Patch(
 'Ingredients Data',
 Defaults('Ingredients Data'),
 {
 'Cake Name': cakeName,
 Ingredients: ingredients
 }
 )
 )
);
Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Krishna_R 

    To start, your formula has the ForAll backward. You are trying to use it like a ForLoop in some development language - which PowerApps is not.  ForAll is a function that returns a table of records based on your iteration table and record schema.

    It is more efficient to use the function as intended and will provide better performance.

     

    Please consider changing your Formula to the following:

    Patch('Ingredients Data',
     ForAll(Gallery1.AllItems,
     {
     'Cake Name': Label2.Text,
     Ingredients: Concat(
     Filter(Gallery3.AllItems As Z, Checkbox2.Value),
     Checkbox2.Text & ";"
     )
     }
     )
    ) 

     

    I hope this is helpful for you.

  • Krishna_R Profile Picture
    525 on at

    Hi @RandyHayes ,

    Thanks for your response. I've tried the other way as you've suggested as well. in both the cases, only cake name is getting saved but not the ingredients value

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Krishna_R 

    Ooops, sorry, copied your formula over and forgot one change!

    Should be:

    Patch('Ingredients Data',
     ForAll(Gallery1.AllItems,
     {
     'Cake Name': Label2.Text,
     Ingredients: Concat(
     Filter(Gallery3.AllItems As Z, Z.Checkbox2.Value),
     Z.Checkbox2.Text & ";"
     )
     }
     )
    ) 

     

  • Krishna_R Profile Picture
    525 on at

    @RandyHayes, - I added the above correction to the formula. but, it was throwing an error stating invalid use of '.' at 

     Z.Checkbox2.Text & ";"
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Krishna_R 

    Is Checkbox2 in Gallery3??

  • Krishna_R Profile Picture
    525 on at

    @RandyHayes  - Yes, It is inside Gallery3

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Krishna_R 

    Ah...oops on my part.  Had the identifier in the wrong spot.

    Patch('Ingredients Data',
     ForAll(Gallery1.AllItems,
     {
     'Cake Name': Label2.Text,
     Ingredients: Concat(
     Filter(Gallery3.AllItems, Checkbox2.Value) As Z,
     Z.Checkbox2.Text & ";"
     )
     }
     )
    ) 
  • Krishna_R Profile Picture
    525 on at

    @RandyHayes - Even after updating the formula, the problem still persists. just to add one more point, I'm having my gallery inside the datacard, is it causing any issue ?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Krishna_R 

    Yes, the gallery in the datacard of a form is not supported.  The AllItems property will not function correctly due to a long standing bug.

    Best thing to do is to move the gallery outside of your form.

  • Krishna_R Profile Picture
    525 on at

    @RandyHayes - Yes, It seems allitems is not working. may i please know if there is any workaround or alternative without moving outside from datacard. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard