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 / checkboxes in a collec...
Power Apps
Answered

checkboxes in a collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Right now i have a collection called traject i am setting the oncheck setting as following
Set(mark; true);;
and on the save button i have
If(mark = true; Set(executive; "Mark "));;
Collect(traject; {executive: executive});;
For some reason in the collection it gives me a 0 if check the box. thanks in advance

Categories:
I have the same question (0)
  • DylanSimons Profile Picture
    326 on at

    you seem to be using semicolon ; instead of comma , in your Set and Collect values, maybe this was a typo?

     

    Instead of setting a variable in the OnCheck property, can you use the Value property in your if statement? The If statement would look like this:

    If(Checkbox1.Value=true,....)

     

    You can achieve the collect in the If as well.

    If(Checkbox1.Value=true, Collect(traject,{executive:"Mark"}))
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    im i put a comma there it gives a error. with a semicolon not.

    But this did fix the problem. now its text. but it still doesnt remove the value when i uncheck it.

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    I was looking at the code you supplied.  The collection is populated by the variable executive.  I do not see where executive is getting its value from.  Is it possible your did not SET a value for executive and therefore it has a value of 0?

     

    OnCheck
    Set(mark; true);;
    
    OnSave
    If(mark = true; Set(executive; "Mark "));;
    Collect(traject; {executive: executive});;

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous

    This problem has nothing do with commas and semi-colons.  Its fine.  Power Apps has different syntax based on your Office 365 language settings.  

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    could be. but in the code it has been given a value right?

     

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    No, it has not.  I am looking at this section of code.

     

    {executive: executive}

     

    To SET the value of executive your would need to do something like this before the code above.

    Set(executive, "my value")

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    but havent i given the value at 

    Set(executive; "Bram "); and the use the "executive" in the collect

  • DylanSimons Profile Picture
    326 on at

    @Anonymous, If you want to use my solution on your Submit button and want it to change with the checked or unchecked box it would look something like this:

     

    If(Checkbox1.Value=true, Collect(traject,{executive:"Mark"}), Collect(traject,{executive:"UnMark"}))

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard