I want to access a specific value of jsonb and update only the value of the key. When writing sql directly, it works properly, but it does not work properly in Retool.
It seems that there is a problem when calling it as a {{}}
value.
The query in question is:
UPDATE pig SET opinions = jsonb_set(opinions, ARRAY[{{currentOpinionKey.value}}]::TEXT[], '{{currentOpinionValue.value}}') WHERE id = {{currentReportDetailId.value}}
{{currentOpinionValue.value}}
If a value is directly entered here, for example, the following query works properly in Retool.
UPDATE pig SET opinions = jsonb_set(opinions, ARRAY[{{currentOpinionKey.value}}]::TEXT[], '"123aaa"') WHERE id = {{currentReportDetailId.value}}