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,
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.
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,
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
@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,
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.
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?
WarrenBelz
146,786
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional