Webhook REST API Key not found

Hi team,

I had a webhook that is throwing a REST API error.
It was working a month ago. But now I keep getting an error that the key value cannot be found
Iโ€™ve double checked my data source. The record with that value is there.
And it successfully shows when I test the webhook.

I made sure the correct useremail / USER ID was there as well.

But I continue to get the error

Any ideas?

0 15 1,022
15 REPLIES 15

@elan_Bailey
Can you copy&paste your API calls JSON request body here? Do you have any valid_if, editable_if, reset_on_edit formulas in any of the target table columns? Please elaborate.

Thanks for you help LeventK

I donโ€™t have any valid_if or editable_if statements in the target table columns.
I have 2 Change Data workflows that check all new Inquiry records, and if certain columns are filled in then a Barrier or a Breakthrough gets created.

I then have two separate workflow/web hooks that trigger when an Inquiry gets updated.
It looks for the breakthrough or Barrier ID and updates the record.

Here are the API Calls:

Breakthrough

{
โ€œActionโ€: โ€œEditโ€,
โ€œPropertiesโ€: {
โ€œLocaleโ€: โ€œen-USโ€,
โ€œLocationโ€: โ€œ47.623098, -122.330184โ€,
โ€œTimezoneโ€: โ€œPacific Standard Timeโ€,
โ€œRunAsUserEmailโ€: โ€œYourEmail@google.comโ€
},
โ€œRowsโ€: [
{
โ€œBreakthrough IDโ€: โ€œ<<REF_ROWS(โ€œBreakthroughsโ€, โ€œSourceโ€)>>โ€,
โ€œSubjectโ€: โ€œ<<[Subject]>>โ€,
โ€œAlignmentโ€: โ€œ<<[Alignment]>>โ€,
โ€œRealignmentโ€: โ€œ<<[Realignment]>>โ€,
โ€œDiscoveryโ€: โ€œ<<[Discovery]>>โ€,
โ€œCommitmentโ€: โ€œ<<[Commitment]>>โ€,
โ€œLife Domainโ€: โ€œ<<[Life Domain]>>โ€,
โ€œSourceโ€: โ€œ<<[Reflection ID]>>โ€
}
]
}
Barriers

{
โ€œActionโ€: โ€œEditโ€,
โ€œPropertiesโ€: {
โ€œLocaleโ€: โ€œen-USโ€,
โ€œLocationโ€: โ€œ47.623098, -122.330184โ€,
โ€œTimezoneโ€: โ€œPacific Standard Timeโ€,
โ€œRunAsUserEmailโ€: โ€œYourEmail@google.comโ€
},
โ€œRowsโ€: [
{
โ€œBarrier IDโ€: โ€œ<<REF_ROWS(โ€œBarriersโ€, โ€œSourceโ€)>>โ€,
โ€œSubjectโ€: โ€œ<<[Subject]>>โ€,
โ€œMisalignmentโ€: โ€œ<<[Misalignment]>>โ€,
โ€œPerceived Barriersโ€: โ€œ<<[Perceived Barriers]>>โ€,
โ€œHidden Commitmentsโ€: โ€œ<<[Hidden Commitment]>>โ€,
โ€œMeaningโ€: โ€œ<<[Meaning]>>โ€,
โ€œImpactโ€: โ€œ<<[Impact]>>โ€,
โ€œDesire Gapโ€: โ€œ<<[Desire Gap]>>โ€,
โ€œDiscoveryโ€: โ€œ<<[Discovery]>>โ€,
โ€œRealignmentโ€: โ€œ<<[Realignment]>>โ€,
โ€œCommitmentโ€: โ€œ<<[Commitment]>>โ€,
โ€œLife Domainโ€: โ€œ<<[Life Domain]>>โ€,
โ€œSourceโ€: โ€œ<<[Reflection ID]>>โ€
}
]
}

I believe your problem generates from the Barrier ID and Breakthrough ID params in the JSON payload. Why do you need to set REF_ROWS(โ€ฆ) expressions for those columns? They are ref columns and will be automatically updated when table data is updated.

Hmmm, I did get help from AppSheet support and was told to enter it this way (with the REF_ROWS).
I tested at that time and it worked successfully.

So are you saying I just need Barrier ID or Breakthrough ID?
From my understanding the first reference is the field in the target table and the second reference is the field in the source table.

So how do I write the reference for the ID Row?
What do I replace โ€œBarrier IDโ€: โ€œ<<REF_ROWS(โ€œBarriersโ€, โ€œSourceโ€)>>โ€, with?

@elan_Bailey
If you are trying to update child records from a parent table, than you need to use <<start: โ€ฆ>> expression in your JSON payload. Worth reading below pages:

Iโ€™ve reviewed the articles and updated my JSON templates as follows:

{
โ€œActionโ€: โ€œEditโ€,
โ€œPropertiesโ€: {
โ€œLocaleโ€: โ€œen-USโ€,
โ€œLocationโ€: โ€œ47.623098, -122.330184โ€,
โ€œTimezoneโ€: โ€œPacific Standard Timeโ€,
โ€œRunAsUserEmailโ€: โ€œYourEmail@google.comโ€
},
โ€œRowsโ€: [
<<Start: Select(Breakthroughs[Breakthrough ID], TRUE)>>
{
โ€œSubjectโ€: โ€œ<<[Subject]>>โ€,
โ€œAlignmentโ€: โ€œ<<[Alignment]>>โ€,
โ€œRealignmentโ€: โ€œ<<[Realignment]>>โ€,
โ€œDiscoveryโ€: โ€œ<<[Discovery]>>โ€,
โ€œCommitmentโ€: โ€œ<<[Commitment]>>โ€,
โ€œLife Domainโ€: โ€œ<<[Life Domain]>>โ€,
โ€œSourceโ€: โ€œ<<[Reflection ID]>>โ€
},
<>
]
}

I still get an error

Error:
โ€œRow key field โ€˜Breakthrough IDโ€™ value is missing.โ€
Properties:
{
โ€œRestAPIVersionโ€: 2,
โ€œTableNameโ€: โ€œBreakthroughsโ€,
โ€œAppTemplateVersionโ€: โ€œ4.001322โ€,
โ€œActionโ€: โ€œEditโ€,
โ€œRestActionTypeโ€: โ€œEditโ€,
โ€œDataActionโ€: โ€œApp: edit this rowโ€,
โ€œlocaleโ€: โ€œen-USโ€,
โ€œrunAsUserEmailโ€: โ€œYourEmail@google.comโ€,
โ€œselectorโ€: โ€œโ€,
โ€œtimezoneโ€: โ€œPacific Standard Timeโ€,
โ€œtzOffsetโ€: โ€œ420โ€,
โ€œuserIdโ€: 141441,
โ€œRowsโ€: 28,
โ€œRowSizeโ€: 11549,
โ€œAppTemplateNameโ€: โ€œe2f3bff9-2204-4acf-90da-568ccef73ad4โ€,
โ€œOperationโ€: โ€œREST API invokeโ€,
โ€œRecordTypeโ€: โ€œStopโ€,
โ€œResultSuccessโ€: false,
โ€œResultErrorโ€: โ€œRow key field โ€˜Breakthrough IDโ€™ value is missing.โ€,
โ€œStatusCodeโ€: โ€œBadRequestโ€,
โ€œPerformanceโ€: โ€œ{โ€œVersionโ€:1,โ€œTimeโ€:โ€œ00:00:00.1847982โ€,โ€œPerformanceTimingRootโ€:{โ€œMidโ€:317,โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00.1847982โ€},โ€œChildrenโ€:[{โ€œMidโ€:62,โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00.1826604โ€}}]},โ€œIsEmptyโ€:false}โ€,
โ€œResultโ€: โ€œFailureโ€
}

You need to specify the key column in the JSON payload, thatโ€™s why you are receiving the error

Thanks . Iโ€™ll reach out to support.

You donโ€™t need to email support for that. Simply you need to add the key column parameter to your JSON payload as itโ€™s specified in the help documentation as well.



Simple as this:
{
	โ€œActionโ€: โ€œEditโ€,
	โ€œPropertiesโ€: {
		โ€œLocaleโ€: โ€œen-USโ€,
		โ€œLocationโ€: โ€œ47.623098, -122.330184โ€,
		โ€œTimezoneโ€: โ€œPacific Standard Timeโ€,
		โ€œRunAsUserEmailโ€: โ€œYourEmail@google.comโ€
	},
	โ€œRowsโ€: [
	<<Start: Select(Breakthroughs[Breakthrough ID], TRUE)>>
		{
			โ€œBreakthrough IDโ€: โ€œ<<[Breakthrough ID]>>โ€, //Key column for the targeted table
			โ€œSubjectโ€: โ€œ<<[Subject]>>โ€,
			โ€œAlignmentโ€: โ€œ<<[Alignment]>>โ€,
			โ€œRealignmentโ€: โ€œ<<[Realignment]>>โ€,
			โ€œDiscoveryโ€: โ€œ<<[Discovery]>>โ€,
			โ€œCommitmentโ€: โ€œ<<[Commitment]>>โ€,
			โ€œLife Domainโ€: โ€œ<<[Life Domain]>>โ€,
			โ€œSourceโ€: โ€œ<<[Reflection ID]>>โ€
		},
	<<End>>
	]
}

Thanks,

I just needed to know the exact way to structure the expression.

Iโ€™m now getting the errorโ€ฆ โ€œErrorsโ€: โ€œError: Failed to parse JSON due to Invalid property identifier character: โ€œ. Path โ€˜Rows[0]โ€™, line 13, position 1โ€ฆ Invalid JSON value starts with: },\n \n\t{\n\tโ€œBreakthrough IDโ€: โ€œ8b96f837โ€,โ€ฆโ€

@elan_Bailey
That might be because of the apostrophes provided you have copied&pasted the payload from my post directly. Try with this one:

{
	"Action": "Edit",
	"Properties": {
		"Locale": "en-US",
		"Location": "47.623098, -122.330184",
		"Timezone": "Pacific Standard Time",
		"RunAsUserEmail": "YourEmail@google.com"
	},
	"Rows": [
	<<Start: Select(Breakthroughs[Breakthrough ID], TRUE)>>
		{
			"Breakthrough ID": "<<[Breakthrough ID]>>",
			"Subject": "<<[Subject]>>",
			"Alignment": "<<[Alignment]>>",
			"Realignment": "<<[Realignment]>>",
			"Discovery": "<<[Discovery]>>",
			"Commitment": "<<[Commitment]>>",
			"Life Domain": "<<[Life Domain]>>",
			"Source": "<<[Reflection ID]>>"
		},
	<<End>>
	]
}

No luck,

Iโ€™ve copy and pasted.
And manually replaced every comma/apostrophe in every row.
Iโ€™ve removed any extra spaces.

Oh and now Iโ€™m back to getting the error that the row key doesnโ€™t exist.
So frustrating

I reversed my last update and am back to the invalid property error:
โ€œErrorsโ€: โ€œError: Failed to parse JSON due to Invalid property identifier character: โ€œ. Path โ€˜Rows[0]โ€™, line 1, position 176โ€ฆ Invalid JSON value starts with: โ€œBreakthrough IDโ€: โ€œ351d3f74โ€,\t"Subjectโ€: โ€œโ€,โ€œAlignmentโ€: โ€œJust following throughโ€ฆโ€,

@elan_Bailey
The error points out to an invalid JSON value so the error is either generating from the payload or the data itself. As I donโ€™t have any info about your app build, table schema etc., itโ€™s hard to say anything. As far as I have checked the JSON payload, it seems correct. May be @Phil needs to intervene here and check your workflow.

Thanks for everything youโ€™ve done to help @LeventK

Hopefully someone from the AppSheet team can check behind the scenes and help me find the source.

Did you ever find the cause of this issue? Iโ€™m having the same problem with โ€œRow having key not foundโ€ and absolutely cannot find the cause.

Top Labels in this Space