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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting checkbox value...
Power Apps
Unanswered

Setting checkbox values from Sharepoint List

(0) ShareShare
ReportReport
Posted on by 44

HI,

 

I have a powerapp that is saving to a Sharepoint List using patch. I then have a gallery to show the users submissions and allow them to edit the submission later (as if they have saved it for later).

 

In this list, I have several columns that have choices. Some are single choices that reflect as radio buttons in the app and some are multiple choices that reflect as checkboxes.

 

When a user selects the edit option for an entry that appears in the gallery, I can pull back most of the info from the Sharepoint list, such as text and radio button choices. However, the checkboxes that I have on the form do not populate. How do I resolve this.

 

I think I am almost there by populating a collection with the choices but I can't seem to reflect these in the check boxes.

 

Any help would be approciated.

Categories:
I have the same question (0)
  • TylerPA Profile Picture
    201 on at

    Would a gallery to display the choices work for you? With items:

    Choices(testList.testChoices)

    and  a checkbox for each gallery row with Text:

    ThisItem.Value

    And then you could filter for selected choices to submit: 

    Filter(Gallery2.AllItems, Checkbox1.Value)

     

    TylerPA_0-1668702557181.png

     

  • Jduggins Profile Picture
    44 on at

    HI,

     

    How would this work? Are you suggesting replacing the checkboxes with a gallery? Would this work with a column that has choices as the data?

     

    I already have the selected checkboxes populatiting the relevant SP list row and when submitted, the SP list updates with the data, I just need that data pulling back and populating the relevant checkboxes if I am viewing that particular entry.

  • TylerPA Profile Picture
    201 on at

    Thanks for clarifying - I was thinking this to display the choice options; can you show how you originally gather the user information? I can always align to get a consistent approach

     

    With this, Default is set to ThisItem.IsSelected, and Text is ThisItem.Value. In a gallery with Items as Choices([@testList].testChoices). The information is displayed similar to the default dropdown

     

    TylerPA_0-1668704732900.png

     

    If you manually wanted to add a few checkboxes:  Manually create Text value, Default as Self.Text in ThisItem.testChoices.Value. And then update for each checkbox

    TylerPA_1-1668705245324.png

     

     

  • Jduggins Profile Picture
    44 on at

    Hi,

     

    So, I have a multi screen app, capturing various info. All fields created through SP list.

     

    User fills in form, may want to 'save form' and return to it. This is done through patch function, updating SP list with all info. User may then want to come back to from to edit and finalise before submission.

     

    When they come back to the form, all previously submitted data should be visible to them. I can get all text and radio button data to appear in the form but not the checkbox data.

     

    Example field:

     

    Jduggins_0-1668766126472.png

    Checkboxes store in collection until save & exit or submit is pressed. This submits to SP list and populates a column with multiple choices options

     

    Jduggins_1-1668766199827.png

    Current user can see incomplete forms in gallery. Clicking on pen takes allows them to edit data. 

     

    How do I ensure that if they have selected certain checkbox data, this pulls back into the form? I get that using ThisItem.RadioButton.Value allows this but I don't know how I achieve this with checkboxes. I have a hidden combo box behind the checkboxes.

  • Verified answer
    TylerPA Profile Picture
    201 on at

    @Jduggins  Please try this - if your hidden combobox is 'DataCardValue2' (replace your sharepoint list with 'testList' below. and 'testChoices' is a choice column from that list)

     

    • Text and default parameters for the check boxes
    • Text  will be the same as available choice values from your sharepoint choice column

    TylerPA_2-1668790058329.png

    TylerPA_4-1668791081716.png

     

    • Default selected items for the hidden combobox

    TylerPA_3-1668791066980.png

     

    • With this, you would still keep your cards update value as 'DataCardValue2.SelectedItems'
    • Changes to checkboxes update the hidden combobox, and also populate correctly when you view an existing entry

     

    TylerPA_0-1668789968222.png

     

  • Jduggins Profile Picture
    44 on at

    HI,

     

    I applied this to a set if checkboxes I have on the form and it worked perfectly.......

     

    However, I went to do the same to another set of checkboxes on another screen and it gives me errors:

     

    Jduggins_0-1669050036382.png

     

    I applied exactly the same logic and code here as I did the page before. Should work the same.

  • TylerPA Profile Picture
    201 on at

    @Jduggins 

     

    Ok - for the new screen, can you show the code values for the new entries outlined above? and confirm the sharepoint list column type

  • Jduggins Profile Picture
    44 on at

    Setup is the same, multiple checkboxes, working with a hidden combobox:

     

    Jduggins_0-1669135469353.png

    Example checkbox

    Jduggins_1-1669135582682.png

    Collection set up for the checkboxes, exactly the same as the original post:

     

    ClearCollect(
    AffectedGroups,
    If(Checkbox23_1.Value,"Sex"),
    If(Checkbox22_1.Value,"Race"),
    If(Checkbox21_1.Value,"Marriage and civil partnership"),
    If(Checkbox20_1.Value,"Sexual orientation"),
    If(Checkbox19_1.Value,"Religion or belief (including no belief)"),
    If(Checkbox18_1.Value,"Pregnancy and maternity"),
    If(Checkbox17_1.Value,"Gender reassignment"),
    If(Checkbox16_1.Value,"Disability"),
    If(Checkbox15_1.Value,"Age"),
    If(Checkbox24_1.Value,"Socio-economic inequalities")
    );
    ClearCollect(
    AffectedGroups,Filter(
    AffectedGroups,
    !IsBlank(Value)
    )
    )

     

    As far as I am aware, both of these sets of checkboxes were set up in the same way yet one set works as you outlined, and one set does not.

  • TylerPA Profile Picture
    201 on at

    @Jduggins 

     

    From the error, 'Value is not recognized'; I would double check the sharepoint column is setup as a choice field, with values entered - if not that, does it give you another option other than 'Value' to use? If there is any mixing of using a collection instead anywhere, it may be expecting a specific column name

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard