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
Super User
Super User

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
Super User
Super User

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

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,332)