cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Gallery data as collection to PowerAutomate

Hi All,

i have been trying to achieve something which seems  a little tricky and i am not able to get my hands around it. 


So currently i have a gallery which can be filtered by 5 Multiple select Combo box and that works absolutely fine.

 

The next requirement is to capture the gallery data into a collection. Now i am aware that you can use clear collect() function to do so but it captures gallery all items, however i would want to capture the data that is being filtered out in the gallery.

Once i capture that i would want to send that collection as json to flows so i can create an excel or maybe an html or text file for the data and send it to the user. is that possible?

 

if yes, please do help me out in this as i am honestly stuck on it.

 

Thank You..

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Gallery data as collection to PowerAutomate

Hi @jayant1 ,

Do you want to save the items that have been filtered out of the gallery and use this collection to send to flow to create a html/text file and send to user?

If so, you just need to use Not before your original condition in your formula of creating collection.

For example:

The gallery's Items:   Filter(table, field1 in combo box1.selecteditems.value, field2 in combo box1.selecteditems.value)

Then you could use this formula to create collection:

ClearCollect(collection1,Filter(table, Not(field1 in combo box1.selecteditems.value, field2 in combo box1.selecteditems.value))

Then the flow's configurations:4237.PNG

 in app, use this formula to call flow:

'423'.Run(JSON(collection1))

//423 is my flow name.

 

 

 

The key point is to use Json function in powerapps to transfer this collection.

Then in flow, use parse json action to get the json data, use the output to create html table, then create file by the html table content.

 

Here's a similar issue for your reference:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Passing-the-PowerApps-Collection-to-MS-Flow/...

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Post Patron
Post Patron

Re: Gallery data as collection to PowerAutomate

@v-yutliu-msft  Thank you for the reply, however i really long code for filtering the gallery through 5 drop-downs. Please find the code at the end of the comment. Do i just change the filter to what you have suggested to compensate for my 5 drop downs? 

if so could you just provide me a sample snippet of what my current code would look like if i follow your approach of filtering gallery based on 5 multi-select drop downs?

This code basically consists of combination check for each drop down value. i would love to see a smaller code through which i can achieve similar functionality of filtering.

Please help me out on this as i have been stuck on it for 4 days now. would appreciate it alot!!

Thanks in advance!!

SortByColumns(  If( 
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
       Talenttracker,
       
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
    Filter(
        Talenttracker,
        Title in ComboBox1.SelectedItems.Result
    ),
    
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Region = ComboBox1_1.Selected.Result
    ),
    
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All"  And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        'Program Name' = ComboBox1_2.Selected.Result
    ),
    
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Year.Value = ComboBox1_3.Selected.Result
    ),

    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
    Talenttracker,
    'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
),

ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And  Region = ComboBox1_1.Selected.Result
    ),

ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And  'Program Name' = ComboBox1_2.Selected.Result
    ),
  
ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And Year.Value = ComboBox1_3.Selected.Result
    ),

    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
    ),
    
ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        'Program Name' = ComboBox1_2.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),

ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Year.Value = ComboBox1_3.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),

    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        'Associate Name'.DisplayName = ComboBox1_4.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
    
ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        'Program Name' = ComboBox1_2.Selected.Result And Year.Value = ComboBox1_3.Selected.Result
    ),

    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        'Program Name' = ComboBox1_2.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
    ),

    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        Year.Value = ComboBox1_3.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
    ),
//1,2,3
ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
      Title = ComboBox1.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
//1,3,4
ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
      Title = ComboBox1.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Year.Value = ComboBox1_3.Selected.Result
    ),
    //1,3,5
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
      Title = ComboBox1.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
    ),
    //1,4,5
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
    Talenttracker,
  Title = ComboBox1.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result
),
    //1,2,4
ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
      Title = ComboBox1.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
//1,2,5
ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
      Title = ComboBox1.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),

//2,3,4
ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
        Filter(
        Talenttracker,
        Year.Value = ComboBox1_3.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
    //2,3,5

    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        'Associate Name'.DisplayName = ComboBox1_4.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
    //2,4,5
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
        Filter(
        Talenttracker,
        'Associate Name'.DisplayName = ComboBox1_4.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And Region = ComboBox1_1.Selected.Result
    ),
//3,4,5
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
    Talenttracker,
    'Associate Name'.DisplayName = ComboBox1_4.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result
),

//5

    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
        Talenttracker,
        Region = ComboBox1_1.Selected.Result And Title = ComboBox1.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And 'Associate Name'.DisplayName = ComboBox1_4.Selected.Result   ),
    
    //2,3,4,5
    ComboBox1.Selected.Result = "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
        Talenttracker,
        Region = ComboBox1_1.Selected.Result And  'Program Name' = ComboBox1_2.Selected.Result And Year.Value = ComboBox1_3.Selected.Result And  'Associate Name'.DisplayName = ComboBox1_4.Selected.Result ),
//1,3,4,5
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result="Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And 'Program Name' = ComboBox1_2.Selected.Result And Year.Value = ComboBox1_3.Selected.Result   And  'Associate Name'.DisplayName = ComboBox1_4.Selected.Result ),
   //1,2,4,5
     ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result="Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And Region = ComboBox1_1.Selected.Result  And Year.Value = ComboBox1_3.Selected.Result   And  'Associate Name'.DisplayName = ComboBox1_4.Selected.Result ),
    //1,2,3,5    
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result="Show All" And ComboBox1_4.Selected.Result<>"Show All",
    Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And Region = ComboBox1_1.Selected.Result  And 'Program Name' = ComboBox1_2.Selected.Result  And  'Associate Name'.DisplayName = ComboBox1_4.Selected.Result  ),
   
      //1,2,3,4      
    ComboBox1.Selected.Result <> "All" And ComboBox1_1.Selected.Result<>"Show All" And ComboBox1_2.Selected.Result<>"Show All" And ComboBox1_3.Selected.Result<>"Show All" And ComboBox1_4.Selected.Result="Show All",
    Filter(
        Talenttracker,
        Title = ComboBox1.Selected.Result And Region = ComboBox1_1.Selected.Result  And 'Program Name' = ComboBox1_2.Selected.Result)

    

    ),"Title",If(sortdescending,Descending,Ascending))

 

Highlighted
Post Patron
Post Patron

Re: Gallery data as collection to PowerAutomate

@v-yutliu-msft  Thank you so much for the reply. However, my gallery consists of 5 multiple select drop downs  and currently i am putting in a really long code for gallery to filter items. The code that you have shown looks pretty neat and smaller too as compared to the code put in my me. i have changed my code as per your code to include all 5 drop downs however, there is one issue in it that the gallery does not show all the data and shows only the data i am filtering, how can i achieve to show all the data and also show filtered data too through your code. Please find the code that i have modified according to my needs below; a suggestion would really make my life simple.

 Filter(Talenttracker, Title in ComboBox1.SelectedItems.Result, Region in ComboBox1_1.SelectedItems.Result ,'Program Name' in ComboBox1_2.SelectedItems.Result , Year.Value in ComboBox1_3.SelectedItems.Result, Concat('Associate Name Multiple',DisplayName,",") in ComboBox1_4.SelectedItems.Result)
Highlighted
Community Support
Community Support

Re: Gallery data as collection to PowerAutomate

Hi @jayant1 ,

My formula above is just an example.

I thought your issue's key problem is the json and flow part...

Since now you want to solve your problem about filtering, please tell me these things:

1)your filter rule?

2)when do you want to  display all the data and when do you want to  show filtered data  in the gallery?

3)your fields' data type?

4)your combo box's Items?

Only if I know more about your conditions, then I could help you about your filter formula.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Post Patron
Post Patron

Re: Gallery data as collection to PowerAutomate

@v-yutliu-msft yes the major issue was the json part too but in order to achieve it  i would want to make my filtering better.

First Rule would be to show all the data in the gallery, like a default value showing all the data in the gallery.

i would want to show all the data once the user gets on the screen and filter the data when the user selects any value from any of the 5 combo box.

which fields data type are you asking for, all the items in the gallery are text values.

Currently for all the 5  combo box i pulling out distinct value from the list and storing it in the combo box. Please find the code below, this code runs on the on-visible of screen and populates the combo box with the distinct column values.

ClearCollect(ppnvalue,{Result:"Show All"});
Collect(ppnvalue,Distinct('Talent Tracker',Title));
ClearCollect(programname,{Result:"Show All"});
Collect(programname,Distinct('Talent Tracker','Program Name'));
ClearCollect(year,{Result:"Show All"});
Collect(year,Distinct('Talent Tracker',Year.Value));
ClearCollect(Regionvalue,{Result:"Show All"});
Collect(Regionvalue,Distinct('Talent Tracker',Region));
ClearCollect(associatename,{Result:"Show All"});
Collect(associatename,Distinct('Talent Tracker','Associate Name'.DisplayName))

The above code populates all the 5 combo-box with an default Show all value along with distinct values from the list.

 

Please help me figure this out as i am really stuck on it.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,783)