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?
@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.
{
โ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.
User | Count |
---|---|
40 | |
34 | |
29 | |
23 | |
17 |