Zapier Webhook Error 500 'Internal server error'

Hi there ,

I am trying to write a record into a datacollection using zapier Webhook POST functionality. Basically, if I update a google spreadsheet, this information is to be recreated/posted into the datacollection.

Here is my code on the back-end:

import wixData from 'wix-data';
import {ok, response} from 'wix-http-functions';

export function post_NeedsAnalysis(request) {
 
 return request.body.json()
    .then(body => {

 let recordInsert = {
 "title": body.Respondent_ID,
 "emailAddress": body.Email_Address,
 "coachingTypenotes": body.Coaching_Type_Notes,
 "generalCoachingNotes": body.General_Coaching_Notes,
 "MentorshipNotes": body.Mentorship_Notes
        };

 return wixData.insert('Analysis',recordInsert)
        .then(result=> ok({body: JSON.stringfly(result)}))
        .catch(err => response({status: 500,body:err}));
    }
 
    );
}
 

The problem is that the webhook does post the data into the datacollection, but returns a ‘500’ error or “internal server error”, then attempts to re-post and ends up creating duplicates.

Any thoughts on why I am getting this error?

Thanks,
Shamal

1 Like

I should add, this is based on the WIXSHOW code for using googlesheets as a datasource to a datacollection.

You put a useless information!
You tell that it is based on some video, but do not show the link to this video?
???

Or do you expect, the helper should now go and search for your VIDEO ?

WIXSHOW…
https://www.youtube.com/channel/UC8klcWotGqYdE3NaQOqTjwg

Sincerest apologies for that! Here is the video link

Hello! I know this is an old post, but I’m wondering if you ever found a fix.