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 / Create a collection ba...
Power Apps
Unanswered

Create a collection based on Data Table

(0) ShareShare
ReportReport
Posted on by 3,271

Hello,

 

Quick question here?

 

How can I collect from a table where my fields are marked as follow:

 

FieldA_Column1, FieldB_Column1, FieldC_Column1, etc.....

 

I am having some hard time with this.

 

 

thanks in advance,

 

 

Regards,

 

Categories:
I have the same question (0)
  • Sajarac Profile Picture
    3,271 on at

    I am trying to create a collection to send that collection to m y flow, so I am using this formula for the onselect action:

     

    ClearCollect(SendtoFlow2(DataTable1Title,UoM,Price,Quantity,Amount,temID,CustomerName,ST,DescriptionCost))

     

    And the result is:

     

    Invocation of unknown or unsupported function.

     

    Any idea? 

  • TiagoFreire Profile Picture
    313 on at

    You have to do stuff one at a time. Collect first, then send it.

     

    ClearCollect(stufftosendtoflow, datasource);
    FlowName.Run(stufftosendtoflow)

     

    Personally, I have better time using JSON to  send stuff to Power Automate (formerly Flow), and use Parse JSON there to manipulate it. 

     

    Set(json_data, JSON(ClearCollect(stufftosendtoflow, datasource)));

    FlowName.Run(json_data)

     

    On Flow, Parse JSON turns it back into an object. 

     

    It also gives me the freedom of asking for a single Params parameter, that I can change the payload as my app evolves, without having to re-add the Flow to my PowerApp every time I add or remove separate parameters. 

  • Sajarac Profile Picture
    3,271 on at

    @TiagoFreire , Thank you very much for your response.

     

    Sorry just clarify, you mean:

    That I need a button to create the collection with this

     

    ClearCollect(stufftosendtoflow, datasource);FlowName.Run(stufftosendtoflow)

     

    Then another button with this:

     

    Set(json_data, JSON(ClearCollect(stufftosendtoflow, datasource)));FlowName.Run(json_data)

     

    Thanks in advance,

     

     

  • Sajarac Profile Picture
    3,271 on at

    OK, here is what I have, the data in my table is from a gallery. 

    Table = DataTable1

    Fields:

    Building Name

    Description

    UoM

    Price

    Quantity

    ItemID    etc

     

    I have tried this one:

    ClearCollect(SendtoFlow2, DataTable1);LabelCustomer,UoM,Price,Quantity,ProjectAmount,BidItem,ItemID,BuildingID,CustomerName,ST,Quote,Contract,DescriptionCost)

     

    This

    ClearCollect(SendtoFlow2, DataTable1,LabelCustomer,UoM,Price,Quantity,ProjectAmount,BidItem,ItemID,BuildingID,CustomerName,ST,Quote,Contract,DescriptionCost)

     

    And this:

    ClearCollect(SendtoFlow2, DataTable1)

     

    And all of them gives me error, any idea?

     

    thanks

     

    Capture.PNG

     

     

     

  • v-xida-msft Profile Picture
    on at

    Hi @sajarac ,

    Could you please share more details about the formula you typed within the Items property of the Data Table?

    Do you want to collect the data from the Data Table into a collection?

     

    Based on the formula you provided, I think there is something wrong with it. If you want to collect all records from the Data Table into a collection, I afraid that there is no way to achieve your needs. Currently, there is no way to collect all records from a Data Table in PowerApps, instead, you could only select single one record once time from the Data Table.

     

    As an alternative solution, if you want to collect all records from the Data Table, please take a try with the following formula:

    ClearCollect(SendtoFlow2, "Type the formula you specified within the Items property of the Data Table here")

    For the second argument of the ClearCollect formula, please type the formula you used for the Items property of the Data Table.

     

    On your side, you should type the following formula within the OnSelect property of the "Submit" button:

    ClearCollect(SendtoFlow2, "Type the formula you specified within the Items property of the Data Table here");
    FlowName.Run(JSON(SendtoFlow2))

    Note: Currently, the flow only accept string parameter passed from an app, you could not pass a JSON Table data from an app to a flow directly. So you need to convert the JSON table value into a JSON String firstly, then pass the converted JSON string into your flow.

    Within your flow, you could use the json() WDL expression to convert the passed JSON String into a JSON table, then you could do some operations on the JSON Table in your flow (e.g. apply a "Apply to each" action to the converted JSON Table).

     

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

     

    Best regards,

  • RK800-1 Profile Picture
    34 on at

    Hi!

     

    I guess you can just try the following:

    ClearCollect(
     Collection_Name,
     Table_name
    )

    And if you want to insert values from the specific columns, you can try the following:

    ClearCollect(
     Collection_Name,
     ForAll(
     ShowColumns(
     Table_Name,
     "Table_Column_Name1",
     "Table_Column_Name2"
     ),
     {
     Collection_Property1: Table_Column_Name1,
     Collection_Property2: Table_Column_Name2
     }
     )
    );

     

    In this example, Collection_Property values can be named whatever you want.

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