Apostrophe ' is added before the number

Nilesh
Nilesh ✭✭✭✭
edited 11/14/22 in API & Developers

Hi All,

i got an issue with one of my column -column 1 - '235245

The number is automatically populated via API but its adds an apostrophe ' before the number.

This is a primary number so i can't change the column type to text and again convert it to a number.

Answers

  • Jeff Reisman
    Jeff Reisman ✭✭✭✭✭✭

    This is because Smartsheet thinks you've fed it string values, not number values.

    I think you have two options here.

    1) Fix the data on the front end with whatever tool you're using to create your API calls, so that it's recognized as number value vs string, or

    2) change your API call to write the data to a helper column, then use the VALUE function in your Primary column to convert the string values to number. ex. =VALUE(HelperColumn@row)

    Regards,

    Jeff Reisman

    Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages

    If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

  • jessica.smith
    jessica.smith ✭✭✭✭✭

    I have experienced the same issue using the API in Bridge.

    To resolve, instead of referencing displayValue, reference value and do not put the relative reference in ""

    Smartsheet will then treat the value as a number instead of as a string and will not include the '

    If the value field is blank, this will cause an error. To resolve, add || to your relative reference, followed by the text you want Smartsheet to include if value is empty

    Example: {{states.startstate.smartsheet.get_row.row.cells.DEC.value||0}}

    Full HTTP Request Body looks like this:

    {
    "cells":
    [
    {"columnId":6493121134415748,"value":{{states.startstate.smartsheet.get_row.row.cells.DEC.value||0}}
    }
    ]
    }