Post

2 followers Follow
0
Avatar

Updating picklist display value entry using REST API

Hi,

We're trying to create and update entries (pickups) in a pickup list.

We have successfully created an entry using a PUT request:

var putPicklistRequest = new HttpRequestMessage(HttpMethod.Put, $"{serverLocation}/data/objects/C_DataDonorCountryName");
putPicklistRequest.Content = new StringContent($"{{ \"id\": \"/C_DataDonorCountryName/UK\" }}");

var putPicklistResponseStr = httpClient.SendAsync(putPicklistRequest).Result.Content.ReadAsStringAsync();

However, we can't figure out how to update the displayValue property. We've tried this:

var updatePicklistRequest = new HttpRequestMessage(HttpMethod.Post, $"{serverLocation}/data/objects/C_DataDonorCountryName");
updatePicklistRequest.Content = new StringContent($"{{ \"id\": \"/C_DataDonorCountryName/TEST3\", \"displayValue\": \"TEST 3\" }}");

var updatePicklistResponseStr = httpClient.SendAsync(updatePicklistRequest).Result.Content.ReadAsStringAsync();

It results in an error: {"errorCode":"InvalidField","message":"Entity 'C_DataDonorCountryName' does not contain the field 'displayValue'","referenceId":"1A9lyTupN1gGAFVGdWhLEg"}

Any suggestions would be greatly appreciated.

 

 

Iulian Chira Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Hello Iulian,

I'm not sure if they can be edited. My suggestion is to delete and then re-add using the new name.

I hope this helps.

Roland

Roland Pumputis 0 votes
Comment actions Permalink