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 / Get all Items from a C...
Power Apps
Answered

Get all Items from a Collection but checked or unchecked

(1) ShareShare
ReportReport
Posted on by 20

Hello,

 

i have a gallery with checkboxes.
In my HTML Control i want to show all possible items from my Gallery that can be checked.
How do i get all these Items to show in my HTML Control?
I also want them to be checked or unchecked if true or false in my HTML Control.

Thank you in advance.

da666_0-1683794389729.png

 

Categories:
  • Verified answer
    KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @da666,

     

    Here is a demo on how to do this:

    KeithAtherton_0-1683796162163.png

     

    In this demo, we'll use data collection colItems set in the screen's OnVisible property:

    ClearCollect(colItems,
     {
     ID:1,
     Name:"Dog",
     Selected:true
     },
     {
     ID:2,
     Name:"Cat",
     Selected:true
     },
     {
     ID:3,
     Name:"Rabbit",
     Selected:false
     }
    );

     

    The gallery control (galItems) has the Data source property set to colItems (above).

    The HTML text control (htmlText) has the following code for the HTML text property:

    Concat(galItems.AllItems, $"<input type='checkbox' {If(Selected, "checked")}>{Name}", "<br>")

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • da666 Profile Picture
    20 on at

    Hey @KeithAtherton,

    thank you that worked.

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Good news! My pleasure. Thanks for the update.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard