How Can I store in a pandas´s df the a webhook´s results

Hi,

I Could Connected a webhook that I Created and Enabled in python, and Im using aws lambda with the url callback made in aws api gateawa. Wich is all well connected.


But as far as I Know, the the event triggered by the webhook just contains the column id and the row id but not the modified value of the cell. So I got stuck because I Need to store in a df the row id, columnd if and the new value of the cell modified in the sheet because I Will use that df to update deals in a crm called pipe due to the organization I work for has the two plattaform connected.


So I wanted to know if some of you have been work with this issues so could help me to solve it in a python´s code.


Thanks in advance.


Bye.

Answers

  • Lee Joramo
    Lee Joramo ✭✭✭✭✭✭

    There are significant security, bandwidth and computer reasons for why the Webhook do not contain more information. You need to take the info provided by the webhook and then make API calls to take the needed actions. It is beyond my time availability to help with the code in this forum, but here is a video and GitHub repository for code.

    https://www.youtube.com/watch?v=qYZ1MZgbQmU

    https://github.com/JakeMarquez/smartsheetdemo

    Yes, it is javascript, but I found it very helpful when I was starting writing webhooks for Smartsheet in both javascript and python.

    Good luck

  • kskarz
    kskarz ✭✭✭✭
    edited 01/27/24

    @alexismgg.31

    The webhook has all the information that you need [sheetID, columnID and rowID]. When you receive the webhook use smartsheet API to make the call to get_row:

    https://api.smartsheet.com/2.0/sheets/{sheetId}/rows/{rowId}

    As you have got the ColumnID you can loop over the results from the get_row and get the modified value.

    Or you can grab the sheet and loop over the results and get the values based on rowID and columnID.

    It all depends on how much data are you expecting to receive in the webhook (would it be 1 row or many rows).