# Update

## Update Entity fields from json

&#x20;Through this Action, users can update an entity record variable with a JSON.&#x20;

1. Select Action as “Update Entity fields from json".&#x20;
2. Select a variable with the data type of the entity.&#x20;
3. Select the Json variable for updating the record.&#x20;
4. Users may choose to define the Action to unset missing fields by selecting the “Unset missing fields” option. By default, this field is unchecked.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_6/ch6updentityfieldsjson.png>" %}

## Update Entity record on match key

Through this Action, users can update an entity record by using Match key criteria of the entity.&#x20;

1. Select Action as “Update Entity record on match key”.&#x20;
2. Select or create JXPResponse variable to store the record.&#x20;
3. Select entity variable (defined with the entity data type in the “Variables” tab).&#x20;
4. Click the "Setup Criteria" button to define and save the match key.&#x20;
5. Users may choose not to trigger a Flow. By default, the option is unchecked.&#x20;
6. Users may choose not to trigger a Validation. By default, the option is checked.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_6/ch6updentityrecordmatchkey.png>" %}

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_6/ch6updentityrecordmatchkeymk.png>" %}

## Update Entity record on primary key

Through this Action, users can update an entity record through the entity's primary key.

1. Select Action as “Update Entity record on primary key”.&#x20;
2. Select or create a JXPResponse variable to store the record.&#x20;
3. Select entity variable (defined with the entity data type in the “variables” tab).&#x20;
4. Users may choose not to trigger a Flow. By default, the option is unchecked.&#x20;
5. Users may choose not to trigger a Validation. By default, the option is unchecked.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_6/ch6updentityrecprimkey.png>" %}
