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 / Display a collection i...
Power Apps
Answered

Display a collection in a table in a form

(0) ShareShare
ReportReport
Posted on by 244

I am trying to recreate a paper form in PowerApps. The paper form includes a repeating table (Audiences for training and whether mandatory or optional for that audience). I followed a tutorial to create a repeating table using a gallery. A collection is created to collect the audiences and course requirement. I would like to display the results of this collection as a table in the main form because the gallery cannot be displayed inline within the form. The gallery repeating table is on a separate screen. I cannot find anything but instruction on how to display a specific field from the collection. How can I accomplish this?

Categories:
I have the same question (0)
  • turnerj3 Profile Picture
    2,039 on at

    Not exactly sure what you mean, but have you tried inserting a data table into the form?

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @CCJones ,

     

    Let me clear some points:

    #1: Having multiple records in 1 form indicates that its a grid of records that typically belongs to other Table that is been referenced to the current Record. Therefore, you cannot embed the Table into a form control. You can show and edit these set of collection separately linking to the Record on the Form. 

    Example: An Order Record has a grid of Products associated to it. Since Products are not part of Order form but linking to Order table

     

    #2: As you mentioned you are creating a Form similar to the paper model you have. You can use this collection below your main form or side-by-side (Different but linked to each other) or even on different screens (ensuring you have linked properly)

     

    Now, if you are collecting, updating records in Collection. Since it has multiple records you need to show them as follows:

    Galley (Editable Grid)

    DataTable (Read-Only)

    1. You can make whatever changes you feel into collection and later bulk save those to the Record linked.

    1. You can only view the records in this.

    2. If you add Labels or Textbox in Gallery, you can reference each column within the collection as "ThisItem.Name" or "ThisItem.Course.Name" depending on the column name and its respective Datatype.

    2. You can select Columns from its properties to show which fields you want to display.

     

    If you are also use Collection[@ColumnName] to refer the column you are pointing to in some formulas (Note: Its collection of Record and not 1 then you need to loop through items)

     

    Hope this helps

  • CCJones Profile Picture
    244 on at

    Thanks for the response! So what I was hoping was that there would be a way to write the contents of the collection into a label or html display field as a table. I already have the setup with separate screens for the repeating table input. It's just that this section of the paper form is in the middle of the form, so placing it at the bottom doesn't really work. Eventually, if the PDF function in PowerApps ever comes to production, they'd like to be able to print the form and it would need to resemble the paper form as closely as possible. 

     

    From your response, I am assuming this just isn't possible. Is that correct?

     

    Thanks!

  • CCJones Profile Picture
    244 on at

    No, I'm pretty new to PowerApps so am not familiar with all the features yet. Can a data table be added to a card in a form? The data gets written back to SharePoint and using the edit form with cards is the simplest solution for me to do this, with the exception of this repeating table, of course. I was thinking I might be able to send it into a rich text multiple lines of text field if I could get the collection data into a text box or rich text box. 

     

    The YouTube video linked below shows the basics of what I've done with regard to creating a repeating table. His is displayed at the bottom of his form, but my customer wants their repeating table in the middle of their form where it currently is in their paper form.

    https://www.youtube.com/watch?v=xgznk4XlPCo

    Just hoping there was a way to write the contents of the collection into a text label or HTML display as a table. Thinking there just isn't, at least not easily.

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @CCJones ,

     

    If you want to simply represent the Layout in a Custom Card within a Form then that's possible. 

    This can be done on the Form properties under 'Add Fields' properties and click ellipses to 'Add a Custom Card'. 

    Simply drag and drop the Card wherever you like and insert your Repeating Table

    YouTube Link for Custom Card on Form

     

    Now considering you want to display Collection as Table using HTML control and then use that content to a column in your Datasource. 

    Well you can do that as well, below is an example I created for the demonstration.

    Here's how the HTML Table looks (Customization is all upto you)

    Ethan_R_0-1685887639095.png

     

    Highlighted area in Red is dynamic content directly from a collection like this

    ClearCollect(
     colMultiLevel,
     {
     FirstName: "Jill",
     LastName: "Smith",
     Age: 50
     },
     {
     FirstName: "Eve",
     LastName: "Jackson",
     Age: 94
     },
     {
     FirstName: "John",
     LastName: "Doe",
     Age: 50
     }
     )

    Just few sample records

     

    In HTML control:

    "<table border='1' width='100%'>" &
    "<thead><tr><th>First Name</th><th>Last Name</th><th>Age</th></thead>" &
    "<tbody>" &
    Concat(colMultiLevel, "<tr><td>" & FirstName & "</td><td>" & LastName & "</td><td>"& Age &"</td></tr>") &
    "</tbody></table>"

     

    That's it!

    Now you can use the following code in the field you want to submit in a Form as

    //Considering my HTML control name is 'HTMLControl'
    
    HTMLControl.HtmlText

     

    By this, entire HTML code with your collection of repeated items will be in the desired format.

     

    Hope this helps

  • CCJones Profile Picture
    244 on at

    Awesome! Works like a charm! Thanks so much!

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard