web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Have Collection renew ...
Power Apps
Answered

Have Collection renew if filter is changed

(0) ShareShare
ReportReport
Posted on by 697

Hey folks,

 

So ultimately I have a button that I want to pass data from a gallery, and using an Automate flow push it into Excel. The Flow part is fine, but the collection is not collecting data how I want. I am trying to only do particular columns only : 

 

 

ClearCollect(LaptopsExcel,ShowColumns(Laptops.AllItems,"AssetName","Username","Allison","AllisonExp","Bendix","BendixExp","CatET","CatETExp"))

 

"Laptops" is of course the name of the gallery, and the "xxx" are all the columns I want. I have this on the OnVisible for the screen.

 

The problem is, this won't work because there is an additional filter. If a user goes to this screen, and then filters, and then presses the button, the collect does not renew post-filter.  So, I should not have this for "Onvisible" but then where should I put it?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @CharlesBrewer 
    If you used the actual Items formula of the gallery instead of Laptops.AllItems, would it work?

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    You should have it do it again as the first action when you press the button before the other actions on the button occur - it will then collect the gallery as it is at that poitn in time (ie with filters)

  • CharlesBrewer Profile Picture
    697 on at

    Thanks for the responses, I went with the 2nd response, it was easier to add it to the button since my Items is pretty long. Thanks that made so much sense, I apparently need more coffee.  If you don't mind a quick follow up question @iAm_ManCat , the columns are going in alphabetical order and not the order I put them in, how do I force them into the order I want?

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    When you say going in - what are you referring to?

    If you're filling an Excel Table (defined as a Table) then it will fill the columns with the data for that column

     

    Unless you mean when you view it in Power Apps from the Formula Bar or the Variables/collections screens?

    Those will be in Alphabetical order as that's how Power Apps will display them

  • CharlesBrewer Profile Picture
    697 on at

    @iAm_ManCat 
    I don't quite have it going to excel yet, I was just looking at the Flow Data.  In my Collection is the order I want the columns, but on the Flow I see it loading alphabetically : 

    CharlesBrewer_0-1676996717156.png

    So I assumed it would load into Excel Alphabetically, which I don't want, because AssetName needs to be the first column.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Ok yeah that shouldn't be an issue - when you fill a Table that has been defined as a Table, it will use the column Name to define where to put the data, it won't put it in the order the columns are received

     

    So it would use whatever column you defined to pull the data from and put it in the column for that, rather than just putting them in alphabetically - in this example below you'd put ZColumn values in ZColumn etc etc, and it will insert the data, not the order of the data, so the order in your Excel won't be affected:

    image.png

  • CharlesBrewer Profile Picture
    697 on at

    The way I am doing it (I am following a youtube video because I don't know what I am doing) it does do it alphabetically.

    CharlesBrewer_0-1677001653625.png

    However, I do see for the "Create CSV table" I can define the rows, so I will try that. If that does not work I will make a separate thread asking for help 🙂

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard