Skip to main content
Community site session details

Community site session details

Session Id : kowZ1FZrMAReH5yqWjTK3v
Power Apps - Building Power Apps
Unanswered

Loop in collection

Like (0) ShareShare
ReportReport
Posted on 14 Nov 2022 04:11:55 by

Hi team,

I would like to create 2 collections, one is Col_TableAndColumn, I used it to saving table and column name, when I click a button, the table and column name will be passed to a power automate flow, and the flow will do "run a query against dataset" to fetch all the value for this column from PowerBI dataset and then response to PowerApps.


ClearCollect(Col_TableAndColumn,
{
TableName:"'salesOrg'",
ColumnName:"[Org Market]"
},
{
TableName:"'salesOrg'",
ColumnName:"[Org SubMarket]"
},

{
TableName:"'salesOrg'",
ColumnName:"[Country]"
}
);

TracyQian_0-1668398033409.png

for the 1st collection Col_TableAndColumn, the result is as following:

TracyQian_2-1668398950278.png

The 2nd collection is Col_ColumnValues, I want to use it to save the table name, column name and also the returned column value from Power Automate flow. 

for the 2nd collection, I want to get the result like following:

Col_ColumnValues 
ColumnNameTableNameData
[Org Market]'salesOrg'returned table value from Power Automate flow
[Org SubMarket]'salesOrg'returned table value from Power Automate flow
[Country]'salesOrg'returned table value from Power Automate flow

 

May I know how to write the 2nd collection? how to fetch these 3 columns (ColumnName, TableName, Data) base on the collection data in 1st collection Col_TableAndColumn? Thanks in advance.

I am trying something like this, but can't fetch the table value for Data Column in 2nd collection.
ForAll(Col_TableAndColumn,
Collect(Col_ColumnValues,
{
TableName: TableName,
ColumnName: ColumnName,
DATA: FetchAllSlicers.Run(DataCardWorkspace.Text,DataCardDataset.Text,TableName&ColumnName)
}
)
)

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Loading complete