Setting multiple custom field values via API

We have predefined custom fields, some of which allow multiple values. I need to be able to set multiple values on custom fields when I am creating (or modifying) projects/folders with the API. The documentation indicates that custom field values must be strings (not arrays of strings as one might expect for being able to specify multiple values).

I have tried the following three experiments:

1. Using an array of strings in spite of what the documentation says. This results in a "bad request" error.

2. Adding multiple values in the same string separated by newlines (trying both unix style and windows style newlines). This results in the creation of a new value for the field that combines the specified values, changing the newlines to spaces.

3. Using the same custom field ID multiple times in the customFields array, once for each value needed. This results in a "bad request" error also.

I'm out of ideas.

0
4 comments
Spot On Innovative Approach Stellar Advice
Avatar

Hello John Winger, welcome to the Community 👋🏻

I see that you're already in touch with our Support team regarding your question. Please let me know if I can help with anything else 🙋🏻‍♀️

Cansu Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Cansu Wrike Team member Become a Wrike expert with Wrike Discover

0
Comment actions Permalink
Spot On Innovative Approach Stellar Advice
Avatar

I did finally end up with a solution that works. It's non-obvious and a little odd why it would be done this way. The custom field value specified on a folder/project can, in fact, only be a string. So instead of allowing for the value to be an array of values, you create the array and then stringify the array and use that string as the value.

For example:

Take an array like this: ["Value 1","Value 2"] and send it as "[\"Value 1\",\"Value 2\"]"

I have successfully set multiple values using this arrangement in my tests.

1
Comment actions Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Thank you for posting the solution! I see way too many posts here where a support ticket is referenced instead of an actual solution and there is no follow-up, leaving the rest of us with the same question still without a solution.

This particular post was serendipitously timed as I was just trying to figure this out myself today and I am sure this saved me a lot of time because that solution would not have been anywhere near the top of my list of things to try 🙂

2
Comment actions Permalink
Spot On Innovative Approach Stellar Advice
Avatar

Hello John Winger, and welcome to the Community Daniel Joelsson 👋🏻

Great to hear that you've found a solution with our Support team! Just for clarity, the reason behind the support tickets is a majority of the cases require sharing of possibly sensitive data that couldn't be posted on public space. We're usually trying to come back to the thread and post the solution from Support if it's similar to this query and the comment here to notify our members to expect an email from our Support.

Please feel free to bump any threads that you don't see any solutions you believe should be publicized and let me know if I can help with something else 🙋🏻‍♀️

Cansu Community Team at Wrike Wrike Product Manager Become a Wrike expert with Wrike Discover

Cansu Wrike Team member Become a Wrike expert with Wrike Discover

1
Comment actions Permalink

Folllowing List for Post: Setting multiple custom field values via API
[this list is visible for admins and agents only]

Top
Didn’t find what you were looking for? Write new post