How to select multiple options in dropdown by c# Smartsheet (NuGet 2.126.0 version)

Harish H
Harish H
edited 06/27/24 in API & Developers

Multiselect dropdown has values - One, Two, Three, Four
and we need to select these options by sending values in c#


I am using below method to add values
cellsToAdd[cellCount] = new Cell.AddCellBuilder(columns[cellCount], true).SetValue(new List<string> { "One", "Two" }).SetStrict(true).Build();

It throws error of unable parse to request
Same goes for string array

And if used plane string - "One,Two", it creates new option in the Smartsheet.

options is not working with this specific Smartsheet NuGet version (2.126.0) - System.Collections.Generic.List<Smartsheet.Api.Models.Option> options = new System.Collections.Generic.List<Smartsheet.Api.Models.Option>();

Tags:

Answers

  • Hi @Harish H

    The Smartsheet API Documentation has examples of methods on the right, where you can select your language preferences.

    In your instance, the example for adding a row with a multi-select cell is as follows:

    {
        ColumnId = addedColumns[0].Id,
        ObjectValue = new MultiPicklistObjectValue(new string[] {"Bat", "Cat"})
      }
    

    I am unfamiliar with NuGet but if you are having trouble with it I would suggest posting in either StackOverflow to get help from other developers or check with NuGet to see if there's an updated version you may need.

    If you've encountered an issue with an SDK, please note that SDKs are not supported directly by Smartsheet Support. However, you can report the issue on the SDK's Github page. This will help ensure that the issue is tracked and addressed appropriately.

    Cheers,
    Genevieve

    Need more help? 👀 | Help and Learning Center

    こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions