Smartsheet - add row with multiple values in cell using c# sdk

1.2k views Asked by At

One of columns has 'Contact List' type with checked 'Allow multiple contacts per cell' see example.

I tried to add row using smartsheet-csharp-sdk(v2.3). Cell object:

new Cell
{
    ColumnId = 111111, 
    Value = "[email protected]",                           
    Strict = false                                    
}

and I got the next error:

{
    "errorCode": 1235,
    "message": "Value is not supported for this column type. Use objectValue instead.",
    "refId": "163zew9slvgfq",
    "detail": {
    "index": 0
}

Then I tried to find how to pass ObjectValue and found only how pass 'Predecessor List', but nothing about multi 'Contact List'.

Question: How to add multi contact list cell using C# SDK ?

1

There are 1 answers

0
stmcallister On BEST ANSWER

Welcome to Stack Overflow, o.jev!

Unfortunately, the C# SDK does not currently support the multi-contact columns. If you wanted to update the value of a multi-contact cell, you'd have to make a native HTTP call (not using the SDK). This would require making a PUT request to the row you want to update, and then your HTTP request body would look like this:

{
    "cells": [
        {
            "columnId": 6654716978456452,
            "objectValue": {
                "objectType": "MULTI_CONTACT",
                "values": [ 
                    {
                        "objectType": "CONTACT",
                        "email": "[email protected]"
                    },
                    {
                        "objectType": "CONTACT",
                        "email": "[email protected]"
                    }
                ]
            }
        }  
     ]
}