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有限公司DE 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
-
Hi@telduzdar,
I think that instead of the comment, you are seeing the discussion title, which is created by "duplicating the first 100 characters of top-level comment." (https://smartsheet.redoc.ly/#operation/discussions-list, response, data, title)
To include the comments to the data response, you should addinclude = 'comments'to your call:
response = smartsheet_client.Discussions.get_all_discussions(sheet_id,include_all=True, include='comments')
Hope that helps!
Answers
-
Hi@telduzdar,
I think that instead of the comment, you are seeing the discussion title, which is created by "duplicating the first 100 characters of top-level comment." (https://smartsheet.redoc.ly/#operation/discussions-list, response, data, title)
To include the comments to the data response, you should addinclude = 'comments'to your call:
response = smartsheet_client.Discussions.get_all_discussions(sheet_id,include_all=True, include='comments')
Hope that helps!
-
Thanks a lot@JKrombeenASKthat parameter did it!
Much appreciated!
Categories
There's nothing we can do as users. It would require a rebuild of that system. I'm pretty sure it's resource intensive, and runs on a schedule performing the automations.<\/p>"},{"commentID":388346,"body":"
No problem. Sorry I didn't have a way to help solve your problem. <\/p>
Having to wait is especially frustrating for me when I'm giving a demo, but that's not the only time I'd like them to execute faster. <\/p>
Consider submitting a Product Idea here (if a search for an already made suggestion isn't available for you to upvote. <\/p>