Hi there!
I’m trying to build an API service which has to set a relation.
From the client the user send a code which is referred to the object which has to be related, the parent object is the user (objectId).
Logic description:
- The user sends a string with the api call to backendless
- The api service has to:
– Check if the code is already in a property of the table
– If it’s true get the objectId of the record with the property
– Use it as child to the relation
– Set the relation: parent object is the objectId of the current user of the table Users
So I’ve used the method called PUT
Here a screenshot of the codeless logic
Hi! Can you provide me your applicationId, please?
yes, 9171DE0B-E8E1-389D-FF48-60C0FD002A00
Hi Mario
take a look at block “Set Object Relations”, there is an input “children” and it can connect an array of objectIds or a “whereClause” as String
in you case it’s a string that’s the reason why you get the “invalid whereClause” error
https://backendless.com/docs/js/data_set_relation_with_condition.html
just wrap block “Get Property objectId of j” into an array block, but don’t forget to click at gear icon on the block and remove two unnecessary list items, at the end there should be only one list item input
Regards, Vlad
AWESOME! Thanks @vladimir-upirov
Yesterday I wasn’t able to do nothing with codeless and today baam! I feel like a boss!
1 Like
Glad to hear it!
if you have any issues just let us know, we are here to help
Regards, Vlad