Post

3 followers Follow
0
Avatar

Add multiple items to a field

I have created a custom field that is an object reference to contacts and I can add multiple contacts through the CLarizen interface but I can't seem to add more than one using the API.

I know I am doing something sill but I can't seem to construct the JSON to add two items to the same field at the same time.

The following request
{"requests":[

{"url" : "/data/objects/Project/id", "method": "POST", "body": {"C_ClientContact" : "/ContactPerson/id"}}]}

works for a single item but no permutation I have tried works for two+ items.

Any help is appreciated

Josh Boutwell Answered

Please sign in to leave a comment.

2 comments

0
Avatar

I would advise you to try dedicated forums for API questions - perhaps they can help if no one here replies with an answer.

Guy 0 votes
Comment actions Permalink
0
Avatar

Hi Josh,

A reference to object field points to a single object.

If the Clarizen UI enables you to add multiple values that suggests you have another custom field on the Customer entity that references the project. 

If I'm right you should update the value of that custom field (on the Contact objects) to desired project.

Hope this helps,

Ophir

Ophir Kenig 0 votes
Comment actions Permalink