cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wedwards
Level: Powered On

Creation of collection on app launch?

Is there a way to create a collection at the time the app is launched?  What I would like even more is to create a temporary collection before the gallery is visible to the user, so I can use the collection as part of the gallery item view. 

 

Additionally, I would like to create a copy of the entire datasource.  I am use a sharepoint list and so the logic I am using is

Collect(collectionName, sharepointListSource) but I am not sure that is correct.

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Level 10

Re: Creation of collection on app launch?

Hi,

When you have no objects selected, you can change the properties of the Screen. The Screen has an OnVisible property which performs actions when you navigate to the screen. This applies to the very first screen of the app too. 

 

So you can set the OnVisible property of Screen1 to:

Collect(collectionName, SharepointListSource)

The limitation is that you may not be able to pull in all records of a datasource with more than 500 records. 

Microsoft Employee
@8bitclassroom

View solution in original post

7 REPLIES 7
mr-dang
Level 10

Re: Creation of collection on app launch?

Hi,

When you have no objects selected, you can change the properties of the Screen. The Screen has an OnVisible property which performs actions when you navigate to the screen. This applies to the very first screen of the app too. 

 

So you can set the OnVisible property of Screen1 to:

Collect(collectionName, SharepointListSource)

The limitation is that you may not be able to pull in all records of a datasource with more than 500 records. 

Microsoft Employee
@8bitclassroom

View solution in original post

wedwards
Level: Powered On

Re: Creation of collection on app launch?

I attempted to do those two things and I expect that it should have worked..  Unfortunately, the table did not load.  However, I added a button and used the onselect and that worked.   I suspect that the failure to load when the object became visible is an bug or undocumented behavior.

 

You were also correct that I was constrained to 500 records.

unknown
Level: Powered On

Re: Creation of collection on app launch?

Hi,

       @mr-dang 

I have a collection in powerapps. The data is also stored in powerapps(no other datasource). Every time I open the application the collection shows no data. I need to set everytime. What do I do to make it set ?

 

Reply ASAP 

mr-dang
Level 10

Re: Creation of collection on app launch?

Hi @unknown,

Collections are temporary by design. Think of them as a shopping cart experience that does not persist.

 

You will want your data saved to a datasource like Excel, SharePoint, Common Data Service, or SQL. In the early modules of the Microsoft Learn experience, you'll learn how to connect an app to Excel.

 

https://aka.ms/learnpowerapps

 

Microsoft Employee
@8bitclassroom
unknown
Level: Powered On

Re: Creation of collection on app launch?

Hi,

        @mr-dang

 

 

On click of menu list how do I select my data source as SQL ?

 

Screenshot_1.pngHere my current data is fetched through collection.How do I bind my sql source to it ?

mr-dang
Level 10

Re: Creation of collection on app launch?

@unknown, you will need to create a connection to your SQL database. Then you can connect its tables.

 

The first section of this blog post goes over how to add a new connection. After that section, you can learn how to add its tables as datasources.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/add-data-connection

Microsoft Employee
@8bitclassroom
Highlighted
unknown
Level: Powered On

Office 365 Active Directory

Hi,

         @mr-dang,
         How to integrate Office 365 (Active Directory) with their roles in any application made in powerapps?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,263)