cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavesTechTips
Super User
Super User

Include collection to include data in app design

Hi everyone

 

Is there a quick way to include a collection (including data) in the design by default, so that the first time the app is launched on a device it has this data without making any data source or API calls?

 

 

Thank you everyone

1 ACCEPTED SOLUTION

Accepted Solutions
v-monli-msft
Community Support
Community Support

Hi @DavesTechTips,

 

You always need to use the Collect() function to create a collection within your app. 

 

Collect( DataSource, Item, ... )

  • DataSource – Required. The data source that you want to add data to. If it does not already exist, a new collection is created.
  • Item(s) - Required. One or more records or tables to add to the data source.

 

You could set the OnVisible property of the first screen of your app with above formula so that it will create a collection as long as the first screen load.

 

For your reference:

https://powerapps.microsoft.com/en-us/tutorials/create-update-collection/

https://powerapps.microsoft.com/en-us/tutorials/function-clear-collect-clearcollect/

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @DavesTechTips,

 

You always need to use the Collect() function to create a collection within your app. 

 

Collect( DataSource, Item, ... )

  • DataSource – Required. The data source that you want to add data to. If it does not already exist, a new collection is created.
  • Item(s) - Required. One or more records or tables to add to the data source.

 

You could set the OnVisible property of the first screen of your app with above formula so that it will create a collection as long as the first screen load.

 

For your reference:

https://powerapps.microsoft.com/en-us/tutorials/create-update-collection/

https://powerapps.microsoft.com/en-us/tutorials/function-clear-collect-clearcollect/

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you.

 

Now with the onstart function on the first screen of the app, this makes it even more viable.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (46,033)