1

As part of my ongoing project of filling in project sheets programmatically with python, I am filling the % Allocated column (which is a column with the TAG 'GANTT_ALLOCATION'). I have been sending my values as floats, which works for the resource views, but displays as floats in smartsheet. Using the curl sdk however seems to display as a percentage. With Python:

this_allocation = 0.5
SS.models.Cell({
    'column_id': column_map['% Allocated'],
    'value': this_allocation,
    # 'display_value': "{:d}%".format(int(this_allocation*100))
})

Displays in Smartsheet: 0.5

with our own old python api that was using the rest api directly, it was getting displayed as 50%. Also if I type it directly in the UI it displays 50%. I have tried setting a display value with no success. I have also tried sending the value as an int (it caps at 1), as a string/unicode (it displays properly but doesn't calculate).

What am I missing? Thanks.

akozi
  • 425
  • 1
  • 7
  • 20
Erwan Leroy
  • 160
  • 10

1 Answers1

2

You'll need to set the formatting of the cell/column as percentage. See the API docs for details on everything that's possible.

SS.models.Cell({
    'column_id': column_map['% Allocated'],
    'value': this_allocation,
    'format': ',,,,,,,,,,,,,,3,'
})
Software2
  • 2,358
  • 1
  • 18
  • 28