cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
narengc
Frequent Visitor

Collection as Gallery Items.

Hi,

I am newbie to Power Apps. I am working on app for which data source is Power BI report. My use case is, On Power App I wanted to users to see the data that has come from Power BI, edit if required or create a new record and write the data to share point Excel.

I am facing issue with basic things. I am adding Power BI data to Collection on App-->On start. on Gallery I am using this collection to display data by filtering based on one drop down.

When I try to use this method, my gallery is not showing any items. However when I add the Power BI data to collection at Main Screen-->On Visible its working.  I do not want to add the data set to Collection at Main screen as this will duplicate the data when I return from other screen. Any suggestions why adding collections at App-->On start is not showing gallery?

 

Here is my code.. On App start , 

ClearCollect(Itemstoshow,[@PowerBIIntegration].Data);

 

On Gallery Items: Filter(Itemstoshow,Region=RegionSel.SelectedText.Result)

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @narengc ,

 

If the app.onstart property doesn't work, here is an alternative workaround. Add a condition in Screen.OnVisible property to generate the collection.

1. Set the Screen.OnVisible:

If(VarNum<>0, ClearCollect(Itemstoshow,[@PowerBIIntegration].Data))

 

2. append Set(VarNum,0) code to the Navigate function in NavigateButton.OnSelect property

Navigate(Screen2);Set(VarNum,0)

Then the collection will only be generated once.

Hope this helps.

Sik

View solution in original post

5 REPLIES 5
KrishnaV
Community Champion
Community Champion

Hi @narengc ,

 

In Power Apps you need to set the data on the screen or you should set it to a collection onStart of the App and set to a gallery in the screen. if you see any issues with the filter on the screen see the below tips or approach to get the required results:

Filter query.png


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
narengc
Frequent Visitor

Hi Krishna,

 

Thank you for the reply. I have set my data to collection on App start and filtering the data on my Gallery Items. For some reason this is not working I mean no data is showing on Gallery however when I set the my data to collection on Screen it is showing the data on my Gallery. Not sure what I am doing wrong.

 

I cant load the data in to collection on Screen because when I navigate from different screens collection is duplicating my data as loading data to collection will be called. Hope I have conveyed the issue properly.

 

 

 

KrishnaV
Community Champion
Community Champion

Hi @narengc ,

 

Try changing the filter as below: 

Items: Filter(Itemstoshow,Region.Value=RegionSel.SelectedText.Result)

 
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
v-siky-msft
Community Support
Community Support

Hi @narengc ,

 

If the app.onstart property doesn't work, here is an alternative workaround. Add a condition in Screen.OnVisible property to generate the collection.

1. Set the Screen.OnVisible:

If(VarNum<>0, ClearCollect(Itemstoshow,[@PowerBIIntegration].Data))

 

2. append Set(VarNum,0) code to the Navigate function in NavigateButton.OnSelect property

Navigate(Screen2);Set(VarNum,0)

Then the collection will only be generated once.

Hope this helps.

Sik

Hi,

 

This workaround has solved my problem. Just curious why on App start we cant load the data to Collectons.

Anyways, Thanks a lot for your help.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,465)