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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data not saving to cus...
Power Apps
Answered

Data not saving to custom entity upon closing app

(0) ShareShare
ReportReport
Posted on by 8

Hi,

 

I've created a canvas app that connects to an environment with two custom entities: Customer and ProcessStep.  For some reason data is not being saved to ProcessStep.  Everything works as expected when I keep the app open, but whenever I close and reopen the app, all the data in ProcessStep is lost!

 

My app dynamically adds records to ProcessStep on the click of a button.  There is a separate screen with a gallery that shows all the records in ProcessStep.  When I keep the app open, everything works as expected.  However, if I close and reopen the app, the gallery shows no data.  It seems that data is not being saved to the ProcessStep entity?  I'm not sure why this would be, as the Customer entity has a very similar design and stores everything as intended.

 

I'm fairly new to using Powerapps so please let me know if you need me to go into more detail on the issue. 

 

Thanks,

 

Matt

Categories:
I have the same question (0)
  • LeeHarris Profile Picture
    1,026 on at

    Hi @mattcole19 

    Can you please share the formula/method you are using on your button click to create the ProcessStep records in your custom entity?

     

  • mattcole19 Profile Picture
    8 on at

    /* Record Lead Info */
    Collect(ProcessSteps, {Company: EditForm1.LastSubmit.Name, Step: "Record Lead Info", Status: "Complete", Employee: User().FullName, DateCompleted: Now() });

     

     

    Now that I look at this, I assume the problem has to deal with the "Collect" function.  What function should I be using?

  • Verified answer
    LeeHarris Profile Picture
    1,026 on at

    Hi @mattcole19 

    The Collect function is adding the object you have defined to a local collection called "ProcessSteps". In order to write the data back to the CDS you can either make use of the Update/UpdateIf function or the Patch function. 

    Update/UpdateIf: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

    Patch function: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch

    Hope that helps!

     

  • mattcole19 Profile Picture
    8 on at

    That should work, thanks!

     

    Just out of curiousity, why is there no function to directly add records?  The "Patch" function seems to be a strange work-around method of adding rows to an entiity.  I imagine adding records is quite common among developers, so why not have a function to make this process simpler/clearer?

  • LeeHarris Profile Picture
    1,026 on at

    Hi @mattcole19 

    If you make use of the Form control, each of the fields are bound to fields in your datasource. There is a Submit command that you can call against the Form control which will then post the new record to CDS. Often I'll be adding data from multiple locations or unbound controls so I tend to favour the Update/Patch functions as they provide more flexibility.

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard