# How to Update a particular row in BDM

**URL:** <https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009>\
**Category:** Q&A\
**Created:** [18 March 2018 12:58 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009 "2018-03-18T12:58:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [18 March 2018 12:58 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/1 "2018-03-18T12:58:09Z")

</div>

Hi  
I have a Simple Process where Users can modify their information like first name , Last name and Mobile number.  
For this, I have created a Table and Populated the table with users data.  
Now in my process , I use a REST API to pull Data from the Table and display in the Form to the user.

Now user can modify the Existing Data and submit. This should update the First table row values for that user.  
Now My Problem is I am unable to perform Update Operation of the table.  
If I create a Object of the Table and use Operations to map the column in the left side and User input on the right side then in this case, it creates a New Row. It does not update the Existing Row.

Since I use REST API to pull data from the Table, hence there is no reference of the Row in the Context.  
Kindly suggest what are the ways I can use to update existing data of any table.

If We need to use JPQL, then please suggest the steps to update BDM using JPQL.  
regards

---

<div class="post-metadata">

**Author:** ![jagch](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jagch](https://community.ofelia.com/u/jagch)\
**Post date:** [20 March 2018 15:22 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/2 "2018-03-20T15:22:59Z")

</div>

Hi, You should look for the row through a query and get the persistenceId then use the following code in Process Data

//Retrieve aggregated Proyectos using its DAO and persistenceId  
def proyectosVar = proyectosDAO.findByPersistenceId(persistence.toLong())  
proyectosVar.Estado = nuevoEstado;  
return proyectosVar;

where persistence and nuevoEstado are contract data obtained from the form.

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [19 March 2018 19:21 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/3 "2018-03-19T19:21:30Z")

</div>

Well I got a solution from Vacation Management example.

---

<div class="post-metadata">

**Author:** ![vgonzalez\_3](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@vgonzalez\_3](https://community.ofelia.com/u/vgonzalez_3)\
**Post date:** [19 April 2018 17:01 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/4 "2018-04-19T17:01:19Z")

</div>

Hello, good day

You could expand a little more on the solution, I’ve been trying to do this before with other options but I have not been successful. Where or how is this script placed, could you help me please?

Thank you in advance.  
Regards,

Victor

---

<div class="post-metadata">

**Author:** ![Dibyajit.Roy](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@Dibyajit.Roy](https://community.ofelia.com/u/Dibyajit.Roy)\
**Post date:** [19 April 2018 17:43 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/5 "2018-04-19T17:43:48Z")

</div>

Hi  
This is how i proceed  
Make sure to create Business Object of the particular table you want to work with.  
Create a service or human task. Map a operation for the service/human task.  
Left hand side, choose the table name , keep the middle section as it is (“Takes a value of”) and on the Right hand side , choose Query.  
Use the Queries called FindByPersistenceId. You may need to pass the persistence Id as a parameter. You can fetch the persistence id from BDM using normal rest api call.  
Also you can use all other Queries like Find by Request id or Find by requester name…depending upon your attributes.  
This will load the Particular row from BDM into your context. Now you can use Context variable from Form to manipulate your BDM row item.  
Let me know if this helps you.  
regards

---

<div class="post-metadata">

**Author:** ![vgonzalez\_3](https://avatars.discourse-cdn.com/v4/letter/v/5e9695/32.png) [@vgonzalez\_3](https://community.ofelia.com/u/vgonzalez_3)\
**Post date:** [19 April 2018 19:40 UTC](https://community.ofelia.com/t/how-to-update-a-particular-row-in-bdm/9009/6 "2018-04-19T19:40:32Z")

</div>

Hi  
I followed your instructions and it worked, thank you very much.

Regards,  
Victor
