Appsheet Edit API call fails despite row key existing

Hi there, i have a slice named โ€œBilled Work Ordersโ€ which contain items that have a [Billed Status] value of either โ€œNot Billedโ€ , โ€œBilledโ€ or โ€œArchivedโ€. My report runs on the 1st of each month & if an entry has a Billed status of โ€œBilledโ€ an API call should be made to change its status to โ€œArchivedโ€.

Right now, that table only has one entry with a โ€œBilledโ€ status and a row key of โ€œ5af32c0bโ€. The issue is that the report log, shows that the API Call fails because of :

โ€œError: โ€œRow having key โ€˜5af32c0bโ€™ not found.โ€โ€

Any ideas on why iโ€™m getting this error since the key actually exists in the table?

0 9 451
9 REPLIES 9

Hi @Stelios_Papamichail,

Could you post a screenshot of your report settings, and copy/paste the JSON body here please?

Sure thing. Hereโ€™s the JSON :

{
   "Action": "Edit",
   "Properties": {
      "Locale": "en-AU",
      "Location": X, Y",
      "Timezone": "Pacific Standard Time",
      "RunAsUserEmail": "email"
   },
   "Rows": [
      {
         "WO_MASTER_UID": "<<[WO_MASTER_UID]>>",
         "JobName": "<<[JobName]>>",
         "ASSIGNED_USER_UID": "<<[ASSIGNED_USER_UID]>>",
         "WO Date": "<<[WO Date]>>",
         "CLIENT_UID": "<<[CLIENT_UID]>>",
         "CLIENT_POOL_UID": "<<[CLIENT_POOL_UID]>>",
         "Describe the problem": "<<[Describe the problem]>>",
         "WO_ACTION_LIST": "<<[WO_ACTION_LIST]>>",
         "Repair Filled By": "<<[Repair Filled By]>>",
         "Repair Req. By": "<<[Repair Req. By]>>",
         "Billed Status": "Archived",
         "LastEditBy": "<<[LastEditBy]>>",
         "LastEditDate": "<<[LastEditDate]>>",
         "CreatedBy": "<<[CreatedBy]>>",
         "CreatedDate": "<<[CreatedDate]>>"
      }
   ]
} 

and hereโ€™s the screenshot of the report settings:

It may not be related to your problem, but the X,Y and Email should both be valid LatLong/Email values.

You can hard-code it with a string, or use HERE(), USEREMAIL(), but the result should be valid for the data type.


Is your Key-Column a Text-Type Column?

If itโ€™s a Number, remove the quotes on the value.

     "WO_MASTER_UID": "<<[WO_MASTER_UID]>>",

Another thought:

If youโ€™re using security filters on this table, then it could be the โ€˜emailโ€™ in Properties thatโ€™s preventing access.

Try hard-coding with the adminโ€™s email, or set the report to bypass security filters.
3X_b_3_b3fd8d15f964093a16458993465c756783ab1563.png

I simply replaced the email and lat long with dummy values for the sake of sharing the info here. They do actually have valid values.

As for the key-column, it is a text type.

Iโ€™ll try enabling the security option.

Update: Bypass Security filter option didnโ€™t solve it. The 404 still occurs.

Hi again, i still havenโ€™t figured it out. I also tried using a webhook to a URL of the recommended format
https://api.appsheet.com/api/v2/apps/{appId}/tables/WO_MASTER/Edit but no luck either. Do you happen to have any other ideas?

The endpoint should end with /tables/{tableName} <-- No /Edit at the end

The ACTION you want to perform (Add/Edit/Delete/Custom_Action_Name) goes in the webhook BODY, not the URL.
3X_9_f_9f45945ca651876c0f773ed0c3a8a0907437be31.png

Authentication may be added to the URL or header.


Here are a few things to try:

  • Focus on authentication first. Check the logs to see why the webhook failed.
  • Try sending webhooks from Postman or Insomnia to verify correct URL formatting and see logs quicker.
  • Test JSON body is valid. https://jsonlint.com/

{
โ€œActionโ€: โ€œEditโ€,
โ€œPropertiesโ€: {
โ€œLocaleโ€: โ€œen-AUโ€,
โ€œLocationโ€: โ€œX, Yโ€, // you have forgotten a quote at the beginning
โ€œTimezoneโ€: โ€œPacific Standard Timeโ€,
โ€œRunAsUserEmailโ€: โ€œemailโ€
},

Do you have any valid_if, reset_on_edit, required_if etc. expression for this [Billed Status] column?

Only a show_if expression. Nothing else

Top Labels in this Space