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

怎甘沉沦 提交于 2019-12-24 12:17:54

问题


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 = "Test@test.com",                           
    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:


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": "user1.email@smartsheet.com"
                    },
                    {
                        "objectType": "CONTACT",
                        "email": "user2.mail@smartsheet.com"
                    }
                ]
            }
        }  
     ]
}


来源:https://stackoverflow.com/questions/53120487/smartsheet-add-row-with-multiple-values-in-cell-using-c-sharp-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!