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

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
Community Support Team
Community Support Team

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. 

Spawn10
Level: Powered On

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.

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?
Community Support Team
Community Support Team

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

Administrator
Administrator

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? 

 

@TopShelf-MSFT

Spawn10
Level: Powered On

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
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
Users Online
Currently online: 310 members 5,694 guests
Recent signins:
Please welcome our newest community members: