I have a webhook running through Zapier and Google Sheets that inserts data into a data set. All is good, except for the photo. It will not insert into the dataset and comes up blank.
I’m running the following in the http_functions.js:
import wixData from ‘wix-data’ ;
import { ok , response } from ‘wix-http-functions’ ;
export function post_ARLfeed ( request ) {
return request . body . json ()
. then ( body => {
let recordInsert = {
“shelterId” : body . shelterId ,
“petName” : body . petName ,
“petType” : body . PetTypeCorrect ,
“petSex” : body . petSex ,
“imageUrl” : body . petImage ,
“petPhoto” : body . petImage ,
“lfDate” : body . lfDate ,
“lfCityPlain” : body . lfCityPlain ,
“lfZip” : body . lfZip ,
“expDate” : body . expDate ,
“lfCounty” : body . lfCounty ,
“petStatus” : body . petStatus ,
“hoomanName” : body . hoomanName ,
“phone” : body . hoomanPhone ,
“shelterBlurb” : body . shelterBlurb
};
return wixData . insert ( ‘Team’ , recordInsert )
. then ( result => ok ({ body : JSON . stringify ( result )}))
. catch ( err => response ({ status : 500 , body : err }));
}
);
}
The “petPhoto” : body . petImage , is where I’m getting a blank space in my dataset instead of the image or the image file. petImage is a URL for the image I want, like: https://arliowa.shelterbuddy.com/storage/image/fd755e24027c408d8e0ad9dedf82b9be-1563641915-1602779931-jpg/1024—n
I’ve also tried making the URL a photo and sending it as a file (multipart/form-data) but am certain the function is not set up properly to receive it.
Obviously I know just enough code to get me into trouble.
Would love a pointer to help solve this.
Thank you!