web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Load Data from an loca...
Power Apps
Unanswered

Load Data from an locally saved connection

(0) ShareShare
ReportReport
Posted on by

I've created a service form app where someone inputs the data directly on the app and that then saves out to Excel. I have an option to save the inputs into a collection that would save offline by selecting a button 'Save Data':

 

ClearCollect(Offline, {ServiceRep:ComboBox2.Selected.Value, Date:DateValue1.SelectedDate, Name:DataCardValue1.Text, Email:DataCardValue11.Text, ...}); SaveData(Offline, "Offline")

 

Then I have another button to 'Load Saved Data': LoadData(Offline, "Offline", true)

 

But I want the saved collection to be put back into the form so the person can continue to edit and then submit. Right now, the load data doesn't do anything (at least from what I can see).

Is it possible to repopulate the form with the inputs from the collection?

DC14_0-1640122119090.png

Thanks!

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    The LoadData() function just recreates the Offline collection that it was saved from.  You'll need to use the values in the Offline collection to populate the defaults of the form to put the values back.

  • Community Power Platform Member Profile Picture
    on at

    Thank you. What would be the best way to populate the defaults of the form if I only want it populated if the user selects the 'Load Data' button?

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    Use an IF() statement in each default property to set it equal to the field value in the collection if the collection isn't null.  Something like this

     

    If(IsEmpty(Offline),"", First(Offline).Name)

     

     

  • Community Power Platform Member Profile Picture
    on at

    Thanks, I really appreciate your help with this. I tried putting in a similar formula and had a question on the different parameters.

    myData--would that be the original data source? So for mine, it links back to Table 1 of my Excel file. 

    First--what does that link to?

    Offline--ok, that's my collection name

    .Name--is that linking to the column field in my collection? Or should I be putting in the value field? (like DataCardValue2.Text)

     

    Thanks!

     

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at
    • Sorry for the typo.  No instead of MyData it should be the name of the collection "Offline".  Its checking to see if the collection has records in it or not.  You'll need to Clear(Offline) after you SaveData to set it to empty.
    • First() gets the first record in the collection. Even if there is only one record you still need to work on the record not the collection.  If you are saving a full data set you may need to use a lookup() instead to get the record.
    • .Name is the field value you are retrieving to populate the default of DataCardValue2

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard