List Discussions function limited characters

Hello,

I am trying to pull all discussion and comments associated with a sheet ID.

I was able to pull using the API through python as shown below.

However the comments came in with only limited characters, in other words I can only see the first 100 characters. Please advice


PYTHON CODE BELOW

"

import smartsheet

import pandas as pd


#Set the Access Token

SMARTSHEET_ACCESS_TOKEN = "xxxxxxxx"


# Initialize client

smartsheet_client = smartsheet.Smartsheet(SMARTSHEET_ACCESS_TOKEN)


#Set the Sheet_id 

sheet_id = xxxxxxxx

sheet = smartsheet_client.Sheets.get_sheet(sheet_id)

print("Loaded Sheet: " + sheet.name)


#Call the discussions for the specified sheet

response = smartsheet_client.Discussions.get_all_discussions(sheet_id,include_all=True)

discussions = response.data


#Transform the discussion data to dictionary format

discussionsDict = response.to_dict()


#Create a comments dataframe from the discussion dictionary

commentsdf = pd.DataFrame.from_dict(discussionsDict['data'])


#Save the comments dataframe to a csv file

commentsdf.to_csv('comments.csv')


"

Best Answer

Answers