Help

Re: Help with payload and Record ID

Solved
Jump to Solution
907 1
cancel
Showing results for 
Search instead for 
Did you mean: 
RichardLG
5 - Automation Enthusiast
5 - Automation Enthusiast

HI, this is my code for my payload posting to a table using Google Apps Script:

 
var payload = JSON.stringify({
"records": [{
"fields": {
"OnlineSubmissionLink": [{ "id": linkedRecordID }], // Set the linked record field
// "SaleDate": formattedSaleDate,
// "SalePrice": donationAmount
 
},
"typecast": true
}]
});
 
My log says: Constructed Payload: {"records":[{"fields":{"OnlineSubmissionLink":[{"id":"recXE6yQpMi1NyWRx"}]},"typecast":true}]}
 
for my payload, but I'm getting this error:
 {"error":{"type":"INVALID_REQUEST_UNKNOWN","message":"Invalid request: parameter validation failed. Check your request data."}}
 
when I attempt to POST the Record ID into the linked record field. 
 
Sorry, I'm no expert so am struggling a bit. Any advice would be ssoooo welcome! 🙏
1 Solution

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Try using an array of the record ID "OnlineSubmissionLink": [linkedRecordID],, not an array of objects. The original web API takes an array of record IDs, not an array of objects (unlike Airtable scripting or the payload from a webhook).

See Solution in Thread

2 Replies 2
kuovonne
18 - Pluto
18 - Pluto

Try using an array of the record ID "OnlineSubmissionLink": [linkedRecordID],, not an array of objects. The original web API takes an array of record IDs, not an array of objects (unlike Airtable scripting or the payload from a webhook).

Thank you so much! Problem solved. 🙏