How to Update a new record in to a existing entity using update entity action?

How to Update a new record in to a existing entity using update entity action?

Hi Swetha,

I would recomend you to do the web developer course first. There you will find all the answers to this kind of basic queries.

https://www.outsystems.com/learn/courses/114/developing-web-apps-outsystems-11/?LearningPathId=2

Hi Swetha,


Your question itself is contradictory, in the sense that you want to update a new record.

By definition, a new record is identified as something to be added to the DB, that is, the record is not present in the DB. Hence, something that does not exist you can not update (read as modified).

In terms of Outsystems, for any record to be created (new), as a practice, the Identifier field is kept as NullIdentifier()

Where as in case of Update the identifier field should have a value, that means, the record is already in DB with an identifier. Hence before updating you need to fetch the record from DB and then update it.


Do let me know if this helps.


Regards,

Saugat 


Swetha bhavani Gutthula wrote:

How to Update a new record in to a existing entity using update entity action?

Hi Swetha 

First you need to check the id if id exist then you can use the update entity action and if id is new then you can used the create entity action.

first you take one if condition and that condition you can check the id exist or not if exist then false branch you can put the Update Entity Action and give the destination..And if Id not exist then in true branch you can put the Create Entity Action and give the destination.


I hope it will help you!

Thanks