# How can we update and save the updated record back to database without using any UI or flow action or flow.

**URL:** <https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146>\
**Category:** General\
**Tags:** data-management, pega-platform\
**Created:** [May 29, 2024, 1:06pm UTC](https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146 "2024-05-29T13:06:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [May 29, 2024, 1:06pm UTC](https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146/1 "2024-05-29T13:06:08Z")

</div>

We have to fetch a single record from the data type and after fetching we have to update it and save back to the database.And all this needs to be done by saveable datapage.No UI or flow or flow action is involved.

For fetching the record we can give the source as Lookup but what should be the saveplan so that the fetched record can be updated and saved back to the data type?

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [May 29, 2024, 1:14pm UTC](https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146/2 "2024-05-29T13:14:01Z")

</div>

@TanyaS58

The same lookup will also work for updating back to the data type. While saving, before the save datapage step, add a property set on the d page as step page where you have to set the new updated values, keeping in mind to set primary key as the actual one from the data type. This will enable the data page to recognize the instance and update it in the table.

---

<div class="post-metadata">

**Author:** ![TanyaS58](https://avatars.discourse-cdn.com/v4/letter/t/b487fb/32.png) [@TanyaS58](https://forums.pega.com/u/TanyaS58)\
**Post date:** [May 30, 2024, 1:57pm UTC](https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146/3 "2024-05-30T13:57:30Z")

</div>

@SohamM95 so in saveplan i need to give the option for an activity and then write the logic to update the record and save iit back to the data type?

---

<div class="post-metadata">

**Author:** ![SohamM95](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/sohamm95/32/4726_2.png) [@SohamM95](https://forums.pega.com/u/SohamM95)\
**Post date:** [May 30, 2024, 2:16pm UTC](https://forums.pega.com/t/how-can-we-update-and-save-the-updated-record-back-to-database-without-using-any-ui-or-flow-action-or-flow/7146/4 "2024-05-30T14:16:02Z")

</div>

@TanyaS58

Yes, use the save-datapage method.
