# 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>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/entities-crud-operations-from-api/update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
