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 / Add multiple items to ...
Power Apps
Answered

Add multiple items to collection (same row)

(1) ShareShare
ReportReport
Posted on by

Hi

I am using the new AI Builder with PowerApps. In my model, I have a table field that contains "QTY" and "NET PRICE". So on the AI Builder element within the PowerApps editor, I add these to a collection called "TableCollection":

 

Collect(TableCollection;FormProcessor1.FormContent.Tables.table_0.QTY;FormProcessor1.FormContent.Tables.table_0.'NET PRICE')


I have then added a simple datatable, to show these values:

Items: TableCollection


However this add each table.item to their own row as below. I would like these to be on the same row:

table.PNG

Categories:
I have the same question (0)
  • SimonPiquer Profile Picture
    255 on at

    Hi,

     

    I am not able to try this using the AI builder currently, but here are my thoughts:

     

    When you deliminate in the Collect function you create a new Item.


    Instead try the following: 

    Collect(TableCollection;{QTY: FormProcessor1.FormContent.Tables.table_0;'NET PRICE':FormProcessor1.FormContent.Tables.table_0)

     
    Would that work?

  • Community Power Platform Member Profile Picture
    on at

    Got a bit closer to a solution I believe. Now the content is on the same row, but it prints [object Object]:

     

    table.PNG

  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Do you want to add the QTY field value and "NET PRICE" field value into a same row of a Collection?

     

    Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

    Set the OnSelect property of the " Button" control to following:

     

    Collect(
    TableCollection;
    {
    QTY: FormProcessor1.FormContent.Tables.table_0.QTY ;
    'NET PRICE': FormProcessor1.FormContent.Tables.table_0.'NET PRICE'
    }
    )

    Or

    ClearCollect(
      TableCollection;
     {
     QTY: FormProcessor1.FormContent.Tables.table_0.QTY ; 
     'NET PRICE': FormProcessor1.FormContent.Tables.table_0.'NET PRICE'
     }
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

     

  • Community Power Platform Member Profile Picture
    on at

    Hi


    Thanks for taking your time to reply. However, it still does not work - still showign [object Object].

     

    Capture.PNG

    For my DataTable.Items: TableCollection

     

     

  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous ,

    Could you please share a bit more about the data structure of your table_0? Are there many records within it?

     

    Please consider modify your formula as below:

    Collect(
    TableCollection;
    {
    QTY: First(FormProcessor1.FormContent.Tables.table_0).QTY ;
    'NET PRICE': First(FormProcessor1.FormContent.Tables.table_0).'NET PRICE'
    }
    )

    Or

    ClearCollect(
      TableCollection;
     {
     QTY: First(FormProcessor1.FormContent.Tables.table_0).QTY ; 
     'NET PRICE': First(FormProcessor1.FormContent.Tables.table_0).'NET PRICE'
     }
    )

     

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    OK I found a solution. It seeems, that instead of adding the table items from the AI Form Processor to a collection, I can simply add them directly to a table.

    So for my table object, I add this to the "Items" field:

     

    FormProcessor1.FormContent.Tables.table_0
  • v-xida-msft Profile Picture
    on at

    HI @Anonymous ,

    Yeah, you are right.

     

    If the result the FormProcessor1.FormContent.Tables.table_0 formula returned is a Table value, you could directly type it within the Items property of that control (e.g. Data Table control).

     

    If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

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