Multiple records are getting added instead of getting updated using API_ImportforCSV

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • In Progress
  • (Edited)
I have a parent and a child table. It is a one to many relationship. I am trying to update multiple records in the child table when I check a checkbox field in the parent table. So, I am trying to use the API_ImportfromCSV in the webhook created in the parent table to fire off when the checkbox is checked in parent table. But, instead of updating records, it is adding new records. Where could I be going wrong?

Following is the API:
<qdbapi><usertoken>b3id8d_bmdk_bcz9fgsdgttp2scecrrmrbaj4x7q</usertoken>
<apptoken>dwnt9wipc3cvfcg6nvd3ba97ps4</apptoken>
<records_csv>
    <![CDATA[
%RepeatOn%
[Payment ID#],[Payment for Client - Record ID#],[Customer - Record ID#],[Payment from Customer]
%RepeatOff%
]]>
</records_csv>
<clist>41.48.46.62</clist>
<msInUTC>1</msInUTC>
<decimalPercent>0</decimalPercent>
</qdbapi>
Photo of Sarthak Subudhi

Sarthak Subudhi

  • 110 Points 100 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,520 Points 50k badge 2x thumb
What field is the Key to the table and is that field included in your list of fields?
Photo of Sarthak Subudhi

Sarthak Subudhi

  • 110 Points 100 badge 2x thumb
[Payment ID#] is the key to the parent table. And even in the table to table relationship between parent to child table [Payment ID#] is the key in the Parent table and [Payment ID#], a field in the child table is the reference field. In the list, I have listed out the field ID of the reference field as 41
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,520 Points 50k badge 2x thumb
But what is the key field on the child table?  It seems to me that the webhook will need to query the children against to know which to update.  Since I'm not an expert on Webhooks, my suggestion is to dumb it does and use ACTIONS  :)  They are way easier to get working and will be easier for other's to maintain in the future.
Photo of Sarthak Subudhi

Sarthak Subudhi

  • 110 Points 100 badge 2x thumb
Thanks for the response. I could use Actions, but they fail to apply for multiple records. 
The logic I was expecting was that based on the payment ID# in parent table, the query recognizes all the records which have the same payment ID in their payment ID column and then update the records. Is this the wrong approach? I am new to webhooks too
(Edited)