#Patch/Udate on relationship field through Rest API

1 messages · Page 1 of 1 (latest)

cosmic harbor
#

Hello,
I don't have an Issue as much as a question. I'm trying to update a field on a custom collection item through the Rest API. This field is not on the item root (this I have managed) but on a relationship link.

Simplified example: I have a custom collection 'tasks' and on these I have made a relationship to the user column. The relationship ('taskUserRel') has a field 'taskUserRelRole' which describes whether somebody is in charge of the task, contributor or observer. I want to update this field.

The Payload Docs don't yield any example for the PATCH queries that would help me figure out the correct syntax for updating the relationship.

Can somebody point me to a an example / documentation?

Thanks and have a good one

cosmic harbor
#

Patch/Udate on relationship field through Rest API

cosmic harbor
#

After a good night's sleep I continued my research and found out that there are useful tools to construct a patch based on a before/after JSON (Kudos: https://json-patch-builder-online.github.io/).
I'm fairly certain that I have the right PATCH-Syntax figured out, I get an OK response, but nothing changes in the database nor in the response object. Can anybody confirm that this should, in principle, work? How would I debug this?

{ "op": "replace", "path": "/taskUserRel/1/taskUserRole", // note that the index of 1 is just an example, I calculate that dynamically "value": "newRole" }