Last year, I had written a post on updating a multi-value Lookup field using REST API. When you are updating a multi-value lookup column, sometimes you would also need to clear the column.
The way we can clear a multi-value lookup column is different than how we would do for a single value lookup column using REST API.
For a single value lookup column, setting a null clears the value. However, for multi-value lookup column, setting a null or blank space does not work. Why? Remember, when you are updating a multi-value column, you would set an array object with the key "results".
So to clear a multi-value lookup column, we need to assign the key "results" to an empty array as shown below:
So if you are using REST API to update a multi-value column, do ensure to have this use case as well to clear the column.
The way we can clear a multi-value lookup column is different than how we would do for a single value lookup column using REST API.
For a single value lookup column, setting a null clears the value. However, for multi-value lookup column, setting a null or blank space does not work. Why? Remember, when you are updating a multi-value column, you would set an array object with the key "results".
So to clear a multi-value lookup column, we need to assign the key "results" to an empty array as shown below:
{ "ColumnId": { "results": [] } }
So if you are using REST API to update a multi-value column, do ensure to have this use case as well to clear the column.
Comments
Post a Comment