cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How do I select items and save them locally to a device

New to PowerApps...I am using a gallery to display several information. I want the user to be able to select an item or mutiple items from the gallery and save them locally on their mobile device. Is this do-able? If so, how do I acoomplish this? I have not been able to find any posts that could point me in the right direction. 

Thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How do I select items and save them locally to a device

Hi @Spawn10,

Do you want to save/cache your Gallery items into your local device?

For your first question, I think you want to create a offline app on your side. I think Connection function, SaveData function and LoadData function could achieve your needs.

On your side, you should create a Collection to store your selected Gallery items firstly:

ClearCollection(CachedRecords, Filter(Gallery1.AllItems, Checkbox1.Value=true)) /* <-- Checkbox1 represents the CheckBox control in your Gallery */

Then use SaveData function to store above Collection to your local device when you are online:

If(
    Connection.Connected,
    SaveData(CachedRecords, "LocalData")
)

If you are offline, use LoadData function to load your cached data into above Collection:

If(
    !Connection.Connected,
    LoadData(CachedRecords, "LocalData",true)
)

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

For your second question, I agree with @wyotim's thought almost. Currently, there is no direct way to see the selected record (within the Gallery) outside an app. As an alternative solution, you could consider take a try to embed the selected data into an email as a HTML Table, then send the email to the specific user.

More details about sending an email with tabular data, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/html-email-reporting-with-tabular-data/

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

6 REPLIES 6
Super User
Super User

Re: How do I select items and save them locally to a device

By "save them locally", do you mean to save the data for use in the app or do you mean save the data to be opened outside of the app?

 

For saving locally for use in the app, there are the SaveData() and LoadData() functions. Here is some info on them. 

 

To save data outside of the app, there isn't a super clean way to do that right now. If that is the case (and even if it isn't), maybe you could reply with some details of what you are wanting to accomplish and we (and others on the forums) can look at some options from there. 

Highlighted
Helper I
Helper I

Re: How do I select items and save them locally to a device

Thanks for the response wyotim,

I am actually faced with both scenarios. On one screen, i want to save the data locally on the device to be used by the app when offline cause there could be instances when there is no connectivity. Then once connectivity is established, the user can sync up the data with the data source.

And on another screen I want to save data that can just be viewwd outside the app. So a user selects a record and want to be able to view it outside the app.

Highlighted
Super User
Super User

Re: How do I select items and save them locally to a device

For the first scenario, you would use SaveData() to write data to the device and LoadData() to pull it in. The link in my previous post will have the proper syntax but feel free to respond if you have any questions about it.

For the second, one method that could work is to have the app send an email to the user with the info needed. There are a few email connectors for PowerApps including one for Office 365, one for Outlook.com, and also a generic one. You can create an html template to format the email using the HTML text box in PowerApps as well. Would that work or do you need something different?
Highlighted
Community Support
Community Support

Re: How do I select items and save them locally to a device

Hi @Spawn10,

Do you want to save/cache your Gallery items into your local device?

For your first question, I think you want to create a offline app on your side. I think Connection function, SaveData function and LoadData function could achieve your needs.

On your side, you should create a Collection to store your selected Gallery items firstly:

ClearCollection(CachedRecords, Filter(Gallery1.AllItems, Checkbox1.Value=true)) /* <-- Checkbox1 represents the CheckBox control in your Gallery */

Then use SaveData function to store above Collection to your local device when you are online:

If(
    Connection.Connected,
    SaveData(CachedRecords, "LocalData")
)

If you are offline, use LoadData function to load your cached data into above Collection:

If(
    !Connection.Connected,
    LoadData(CachedRecords, "LocalData",true)
)

Please check and see if the following blog would help in your scenario:

https://powerapps.microsoft.com/en-us/blog/build-offline-apps-with-new-powerapps-capabilities/

 

For your second question, I agree with @wyotim's thought almost. Currently, there is no direct way to see the selected record (within the Gallery) outside an app. As an alternative solution, you could consider take a try to embed the selected data into an email as a HTML Table, then send the email to the specific user.

More details about sending an email with tabular data, please check the following blog:

https://powerapps.microsoft.com/en-us/blog/html-email-reporting-with-tabular-data/

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Highlighted
Anonymous
Not applicable

Re: How do I select items and save them locally to a device

Thanks for your help within this thread @wyotim and @v-xida-msft@Spawn10 - can you advise if any of the responses have helped your issues? 

 

@Anonymous

Highlighted
Helper I
Helper I

Re: How do I select items and save them locally to a device

Thanks @v-xida-msft SaveDate and LoadData was able to help me with what I was trying to accomplish. Many thanks for pointing me in the right direction.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,041)