Add Rows with a Date inside API

Hello everyone,

I'm struggling with a method in Smartsheet API to add several rows to a sheet with Date Columns included.

The point is compared with "update_rows" where it's working perfectly, when I try to use add_rows, the date format stays in ISO format and looks like this:

Which is not the case with update_row where I'm updating keeping the proper format I'm looking for:

And by keeping this format properly, all my side formulas are working while it's not the case for added lines.

I'm thinking to resolve this by first creating the rows and then updating it so that the dates will be ok, but that would clearly increase my time execution (I guess?). Is there a way to modify the "add_row" input to fix this issue that I might have missed?

Thank you!

Best regards,

Jérémy

Best Answer

  • Jeremy RENAUDIN
    Jeremy RENAUDIN ✭✭✭
    Answer ✓

    Hi,

    I've answered myself this morning by reading again the API help, leaving the answer just in case if it helps someone :)

    I was using the cell.strict = False as default as in the API examples. Wrong idea for the add_row. As long as the ISO format is used, this condition is not required and can be changed to cell.strict = True.

    Best regards,

    Jérémy

Answers

  • Jeremy RENAUDIN
    Jeremy RENAUDIN ✭✭✭
    Answer ✓

    Hi,

    I've answered myself this morning by reading again the API help, leaving the answer just in case if it helps someone :)

    I was using the cell.strict = False as default as in the API examples. Wrong idea for the add_row. As long as the ISO format is used, this condition is not required and can be changed to cell.strict = True.

    Best regards,

    Jérémy