Hello, I'm trying to use the Zapier integrati...

Hello, Iโ€™m trying to use the Zapier integration with AppSheet but when I search for AppSheet in Zapier it doesnโ€™t come up.

Is there another step I should be following to get AppSheet to be available to me in the Zapier system?

0 36 989
36 REPLIES 36

@Daisy_Ramirez

In the Audit History at 10/7/2018 8:27:44 PM I see the following API record.

Properties:

{

โ€œOperationโ€: โ€œREST API invokeโ€,

โ€œAppIdโ€: โ€œbfde3f7a-a539-48cb-b84e-362ea81270f5โ€,

โ€œTableNameโ€: โ€œSheet54โ€,

โ€œResultโ€: โ€œFailureโ€,

โ€œResultErrorโ€: โ€œREST API REST API invoke request failed: Failed to get API โ€˜Rowsโ€™ due to: โ€˜fileโ€™ is not a valid table column nameโ€ฆโ€,

โ€œRecordTypeโ€: โ€œStopโ€ }

That error message indicates that โ€œfileโ€ is not one of the fields in the

In the Audit History at 10/7/2018 8:27:44 PM I see the following Webhook audit record for rule โ€œfavorites_to_tasksโ€. As the API audit records indicates, the Row data appears to specify a field called โ€œfileโ€ that I do not see in the schema for table โ€œSheet54โ€. It is likely to work if you remove that field from your webhook JSON body template. ".

Properties:

{

โ€œAppTemplateNameโ€: โ€œ3rdArm-506404โ€,

โ€œAppIdโ€: โ€œbfde3f7a-a539-48cb-b84e-362ea81270f5โ€,

โ€œAppTemplateVersionโ€: โ€œ1.003994โ€,

โ€œRuleNameโ€: โ€œfavorites_to_tasksโ€,

โ€œEventTypeโ€: โ€œChangeโ€,

โ€œOperationโ€: โ€œChange workflow ruleโ€,

โ€œRuleEvalModeโ€: โ€œProductionโ€,

โ€œTableNameโ€: โ€œtask_favoritesโ€,

โ€œRuleTableNameโ€: โ€œtask_favoritesโ€,

โ€œOperationUpdateModeโ€: โ€œUPDATES_ONLYโ€,

โ€œEventMatchโ€: โ€œWorkflow event successfully matchedโ€,

โ€œConditionโ€: โ€œ=AND(USEREMAIL()=[createdBy], [activate]=TRUE)โ€,

โ€œMatchesConditionโ€: โ€œTrueโ€,

โ€œActionsโ€: โ€œCreated 1 Actionsโ€,

โ€œUrlโ€: โ€œhttps://api.appsheet.com/api/v1/apps/bfde3f7a-a539-48cb-b84e-362ea81270f5/tables/Sheet54/Actionโ€,

โ€œVerbโ€: โ€œPostโ€,

โ€œHeadersโ€: โ€œapplicationAccessKey:Uโ€ฆโ€,

โ€œPayloadโ€: โ€œ{\r\n"Actionโ€: โ€œAddโ€,\r\n"Properties": {\r\n"Locale": โ€œen-USโ€,\r\n"Location": โ€œ47.623098, -122.330184โ€,\r\n"Timezone": โ€œPacific Standard Timeโ€\r\n},\r\n"Rows": [\r\n{\r\n"name": โ€œbuy strawberriesโ€,\r\n"ItemNo": โ€œ21245456โ€,\r\n"quantity": โ€œ1โ€,\r\n"task_supplier_id": โ€œ59d262f510e3d13d3173b2baโ€,\r\n"image": โ€œโ€,\r\n"detail": โ€œโ€,\r\n"list": โ€œ59dcd1d410e3d13d31732018โ€,\r\n"sub_list": โ€œGroceriesโ€,\r\n"file": โ€œWeekly Groceriesโ€,\r\n"activate": โ€œYโ€\r\n}\r\n",

โ€œPerformanceโ€: โ€œ{โ€œVersionโ€:1,โ€œTimeโ€:โ€œ00:00:00โ€,โ€œPerformanceTimingRootโ€:{โ€œMidโ€:154,โ€œParamsโ€:{โ€œParamListโ€:[{โ€œPidโ€:13,โ€œValueโ€:โ€œtask_favoritesโ€}]},โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00โ€},โ€œChildrenโ€:[]}}โ€,

โ€œResultโ€: โ€œSuccessโ€ }

@Daisy_Ramirez

You can specify the JSON body in either the Body or Body Template. I tried both, and both worked for me.

The API can be triggered by: 1. The web hook workflow rule 2. Zapier 3. Doing a post from any system capable of doing an HTTP post.

Letโ€™s use the Audit History to figure this out. Please do the following:

  1. Add a record to table โ€œtask-favoritesโ€ 2. After the webhook workflow rule fires, look at Audit History and find rule โ€œfavorites_to_tasksโ€. It may take a minute or two for the record to show up. They are written in batches. 3. Look at the โ€œPayloadโ€ value in the webhook audit record. You want to see something like:

{

โ€œActionโ€: โ€œAddโ€,

โ€œPropertiesโ€: {

โ€œLocaleโ€: โ€œen-USโ€,

โ€œTimezoneโ€: โ€œEastern Standard Timeโ€

},

โ€œRowsโ€: [

{

โ€œnameโ€: โ€œ<<[name]>>โ€,

โ€œitemNoโ€: โ€œ<<[itemNo]>>โ€,

โ€œquantityโ€: โ€œ<<[quantity]>>โ€,

โ€œtask_supplier_idโ€: โ€œ<<[task_supplier_id]>>โ€

โ€œimageโ€: โ€œ<<[image]>>โ€

โ€œdetailโ€: โ€œ<<[detail]>>โ€

โ€œlistโ€: โ€œ<<[list]>>โ€

โ€œsub_listโ€: โ€œ<<[sub_list]>>โ€

}

] }

The Audit Record at 10/5/2018 8:03:02 PM looked like this:

โ€œPayloadโ€: "{\r\n

โ€œnameโ€: โ€œtest anotherโ€,\r\n

โ€œitemNoโ€: โ€œbuy stuffโ€,\r\n

โ€œquantityโ€: โ€œ1โ€,\r\n

โ€œtask_supplier_idโ€: โ€œ59d7c79f10e3d13d3173b300โ€,\r\n

โ€œimageโ€: โ€œโ€,\r\n

โ€œdetailโ€: โ€œโ€,\r\n

โ€œlistโ€: โ€œ59d7d06810e3d13d3173b303โ€,\r\n

โ€œsub_listโ€: โ€œGroceriesโ€,\r\n

โ€œactivateโ€: โ€œYโ€\r\n}\r\n",

(Ignore the slashes in front of the quotes and all โ€œ\r\nโ€ values. โ€œ\r\nโ€ is carriage return and line feed and it appears on each new line.)

This payload is missing the Action, Properties, etc. It looks like only the data fields are present.

The API correctly rejected that payload saying the Action was missing.

RESOLVED: Found notes on initial connection help.appsheet.com - Connect a Zapier โ€œZAPโ€ to Your App Connect a Zapier โ€œZAPโ€ to Your App help.appsheet.com

@Daisy_Ramirez

Depending on what you are trying to do, it may be easier to use a webhook to call the AppSheet API directly. See help.appsheet.com - Example: Copying Newly Added Records

You can use a similar approach for doing updates. Example: Copying Newly Added Records help.appsheet.com

@Daisy_Ramirez

I am not clear if webhooks and the API are germaine in this case.

Let me explain how webhooks and the API are used. 1. You create a webhook that is is triggered when the client sends an add, update, or delete request to the server.

  1. The webhook then invokes the API to:

a. Add one or more records.

b. Update one or more records.

c. Delete one or more records.

d. Invoke an Action on one or more records.

In order for the webhook and the API to be helpful in your case, you would need to perform an add, update, or delete that would trigger the webhook. I am not clear how the user selecting one or more values from their favorites list would trigger an add, update, or delete that would trigger the webhook.

@Philip_Garrett_Appsh

Yes you are exactly right. In my scenario, a user would set several records to Send

(a Y/N field.) allowing the workflow to trigger.

My inexperience is with the webhook. Can you send a sample webhook for an Add to table scenario? Again, Iโ€™m looking to create copies of the records from the tasks_favorites table and copy them to the tasks table.

Any help would be great a million thanks.

@Philip_Garrett_Appsh Thanks Philip โ€ฆIโ€™ll try it now and confirm back

Is there a field mapping example for the JSON Body? I see where it outlines the field name and the corresponding data to the field in the JSON file for the tasks_favorites table but where do I specify which fields the data would go to in the tasks table ? Can this be done as an expression? Do you have an example of what a file like this would look like?

@Philip_Garrett_Appsh Is there a field mapping example for the JSON Body? I see where it outlines the field name and the corresponding data to the field in the JSON file for the tasks_favorites table but where do I specify which fields the data would go to in the tasks table ? Can this be done as an expression? Do you have an example of what a file like this would look like?

@Daisy_Ramirez

Hi Philip - no luck. Iโ€™m getting a success in the audit logs but again nothing is posting to the tasks table. Hereโ€™s the body data - I canโ€™t find what Iโ€™m doing wrong:

{ โ€œActionโ€: โ€œAddโ€, โ€œPropertiesโ€: { โ€œLocaleโ€: โ€œen-USโ€, โ€œLocationโ€: โ€œ47.623098, -122.330184โ€, โ€œTimezoneโ€: โ€œPacific Standard Timeโ€ }, โ€œRowsโ€: [ { โ€œnameโ€: โ€œ<<[name]>>โ€, โ€œItemNoโ€: โ€œ<<[itemNo]>>โ€, โ€œquantityโ€: โ€œ<<[quantity]>>โ€, โ€œtask_supplier_idโ€: โ€œ<<[task_supplier_id]>>โ€, โ€œimageโ€: โ€œ<<[image]>>โ€, โ€œdetailโ€: โ€œ<<[detail]>>โ€, โ€œlistโ€: โ€œ<<[list]>>โ€, โ€œsub_listโ€: โ€œ<<[sub_list]>>โ€, โ€œfileโ€: โ€œ<<[file]>>โ€, โ€œactivateโ€: โ€œ<<[activate]>>โ€ }

Hi Philip still no luck. I inserted the field โ€œfileโ€ in Sheet54 to match test_favorites and got the success result but the additional record did not post to Sheet55. Here it is for quick review:

Properties:

{

โ€œAppTemplateNameโ€: โ€œ3rdArm-506404โ€,

โ€œAppIdโ€: โ€œbfde3f7a-a539-48cb-b84e-362ea81270f5โ€,

โ€œAppTemplateVersionโ€: โ€œ1.003996โ€,

โ€œRuleNameโ€: โ€œfavorites_to_tasksโ€,

โ€œEventTypeโ€: โ€œChangeโ€,

โ€œOperationโ€: โ€œChange workflow ruleโ€,

โ€œRuleEvalModeโ€: โ€œProductionโ€,

โ€œTableNameโ€: โ€œtask_favoritesโ€,

โ€œRuleTableNameโ€: โ€œtask_favoritesโ€,

โ€œOperationUpdateModeโ€: โ€œUPDATES_ONLYโ€,

โ€œEventMatchโ€: โ€œWorkflow event successfully matchedโ€,

โ€œConditionโ€: โ€œ=AND(USEREMAIL()=[createdBy], [activate]=TRUE)โ€,

โ€œMatchesConditionโ€: โ€œTrueโ€,

โ€œActionsโ€: โ€œCreated 1 Actionsโ€,

โ€œUrlโ€: โ€œhttps://api.appsheet.com/api/v1/apps/bfde3f7a-a539-48cb-b84e-362ea81270f5/tables/Sheet54/Actionโ€,

โ€œVerbโ€: โ€œPostโ€,

โ€œHeadersโ€: โ€œapplicationAccessKey:UUs1Q-zxY1W-KS8WP-cKUE4-nT6ES-Ow7qh-ZYmWk-AnYQoโ€,

โ€œPayloadโ€: โ€œ{\r\n"Actionโ€: โ€œAddโ€,\r\n"Properties": {\r\n"Locale": โ€œen-USโ€,\r\n"Location": โ€œ47.623098, -122.330184โ€,\r\n"Timezone": โ€œPacific Standard Timeโ€\r\n},\r\n"Rows": [\r\n{\r\n"name": โ€œhoney crisp applesโ€,\r\n"ItemNo": โ€œ78665433โ€,\r\n"quantity": โ€œ1โ€,\r\n"task_supplier_id": โ€œ59d262f510e3d13d3173b2baโ€,\r\n"image": โ€œโ€,\r\n"detail": โ€œโ€,\r\n"list": โ€œ59dcd1d410e3d13d31732018โ€,\r\n"sub_list": โ€œGroceriesโ€,\r\n"file": โ€œWeekly Groceriesโ€,\r\n"activate": โ€œYโ€\r\n}\r\n",

โ€œPerformanceโ€: โ€œ{โ€œVersionโ€:1,โ€œTimeโ€:โ€œ00:00:00โ€,โ€œPerformanceTimingRootโ€:{โ€œMidโ€:154,โ€œParamsโ€:{โ€œParamListโ€:[{โ€œPidโ€:13,โ€œValueโ€:โ€œtask_favoritesโ€}]},โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00โ€},โ€œChildrenโ€:[]}}โ€,

โ€œResultโ€: โ€œSuccessโ€

@Daisy_Ramirez

What do you see in the Audit History for the REST APIinvoke call?

Thanks Philip

checking it nowโ€ฆ

ok I see that it does not populate Initial Value fields although the document says it does? See text below. Iโ€™ll add those fields here and confirm backโ€ฆ

From Doc: When a Record is Added All fields are initialized to initial values and all app formulas are computed. The field values you specify in the request are applied. App formulas are computed and change fields are updated. Required, Required_If, and Valid_If conditions are enforced. The record or records are added to the table. Workflow rules, if any, are invoked.

Properties:

{

โ€œOperationโ€: โ€œREST API invokeโ€,

โ€œAppIdโ€: โ€œbfde3f7a-a539-48cb-b84e-362ea81270f5โ€,

โ€œTableNameโ€: โ€œSheet54โ€,

โ€œActionโ€: โ€œAddโ€,

โ€œRestActionTypeโ€: 1,

โ€œDataActionโ€: โ€œApp: add a new row (not a row-level action)โ€,

โ€œlocaleโ€: โ€œen-USโ€,

โ€œlocationโ€: โ€œ47.623098, -122.330184โ€,

โ€œrunAsUserEmailโ€: โ€œโ€,

โ€œtimezoneโ€: โ€œPacific Standard Timeโ€,

โ€œtzOffsetโ€: โ€œ420โ€,

โ€œuserIdโ€: 506404,

โ€œRowsโ€: 1,

โ€œPerformanceโ€: โ€œ{โ€œVersionโ€:1,โ€œTimeโ€:โ€œ00:00:00.3483254โ€,โ€œPerformanceTimingRootโ€:{โ€œMidโ€:317,โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00.3483254โ€},โ€œChildrenโ€:[{โ€œMidโ€:62,โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00.3395982โ€}}]}}โ€,

โ€œResultโ€: โ€œFailureโ€,

โ€œResultErrorโ€: โ€œError: Field โ€˜createdByโ€™ in table โ€˜Sheet54โ€™ having key โ€˜honey crisp applesโ€™ is required to have a value.โ€,

โ€œRecordTypeโ€: โ€œStopโ€ }

Ok added the fields to the JSON filed as they were already represented in Sheet54. Ran it again and received a success result but nothing posted to Sheet54

Properties:

{

โ€œAppTemplateNameโ€: โ€œ3rdArm-506404โ€,

โ€œAppIdโ€: โ€œbfde3f7a-a539-48cb-b84e-362ea81270f5โ€,

โ€œAppTemplateVersionโ€: โ€œ1.003999โ€,

โ€œRuleNameโ€: โ€œfavorites_to_tasksโ€,

โ€œEventTypeโ€: โ€œChangeโ€,

โ€œOperationโ€: โ€œChange workflow ruleโ€,

โ€œRuleEvalModeโ€: โ€œProductionโ€,

โ€œTableNameโ€: โ€œtask_favoritesโ€,

โ€œRuleTableNameโ€: โ€œtask_favoritesโ€,

โ€œOperationUpdateModeโ€: โ€œUPDATES_ONLYโ€,

โ€œEventMatchโ€: โ€œWorkflow event successfully matchedโ€,

โ€œConditionโ€: โ€œ=AND(USEREMAIL()=[createdBy], [activate]=TRUE)โ€,

โ€œMatchesConditionโ€: โ€œTrueโ€,

โ€œActionsโ€: โ€œCreated 1 Actionsโ€,

โ€œUrlโ€: โ€œhttps://api.appsheet.com/api/v1/apps/bfde3f7a-a539-48cb-b84e-362ea81270f5/tables/Sheet54/Actionโ€,

โ€œVerbโ€: โ€œPostโ€,

โ€œHeadersโ€: โ€œapplicationAccessKey:UUs1Q-zxY1W-KS8WP-cKUE4-nT6ES-Ow7qh-ZYmWk-AnYQoโ€,

โ€œPayloadโ€: โ€œ{\r\n"Actionโ€: โ€œAddโ€,\r\n"Properties": {\r\n"Locale": โ€œen-USโ€,\r\n"Location": โ€œ47.623098, -122.330184โ€,\r\n"Timezone": โ€œPacific Standard Timeโ€\r\n},\r\n"Rows": [\r\n{\r\n"name": โ€œbuy strawberriesโ€,\r\n"ItemNo": โ€œ21245456โ€,\r\n"quantity": โ€œ1โ€,\r\n"task_supplier_id": โ€œ59d262f510e3d13d3173b2baโ€,\r\n"image": โ€œโ€,\r\n"detail": โ€œโ€,\r\n"list": โ€œ59dcd1d410e3d13d31732018โ€,\r\n"sub_list": โ€œGroceriesโ€,\r\n"file": โ€œWeekly Groceriesโ€,\r\n"activate": โ€œYโ€,\r\n"createdBy": "3rdarmlife@gmail.com",\r\n"createdAt": โ€œ10/5/2018 12:33:00 PMโ€,\r\n"fav_id": โ€œ100718โ€,\r\n}\r\n",

โ€œPerformanceโ€: โ€œ{โ€œVersionโ€:1,โ€œTimeโ€:โ€œ00:00:00โ€,โ€œPerformanceTimingRootโ€:{โ€œMidโ€:154,โ€œParamsโ€:{โ€œParamListโ€:[{โ€œPidโ€:13,โ€œValueโ€:โ€œtask_favoritesโ€}]},โ€œTimerโ€:{โ€œTimeโ€:โ€œ00:00:00โ€},โ€œChildrenโ€:[]}}โ€,

โ€œResultโ€: โ€œSuccessโ€ }

@Daisy_Ramirez

I see a matching record in row 2 of table โ€œSheet54โ€.

Yes its an old sample record. Should I clear Sheet54 and re-test? Remember Iโ€™m looking to add a record to Sheet54 so Iโ€™m looking for that 4th record

@Daisy_Ramirez

Yes, because if a record having the same key you are trying to Add already exists, then we turn the Add into and Update. That is probably what happened here.

Hi Philip, the record populated! What if the field names in the receiving table are different than the origninal table? How do I set the field values to other values? Can I use drefโ€™s or expressions here in the field values ? Do you have sample JSON files where calculated values are used?

Thanks so much for your help

@Daisy_Ramirez

Just a quick note, I cleared Sheet54 and ran it again and thatโ€™s when the record posted. Tested 3 records successfully

@Daisy_Ramirez

You can write any expression you like to populate the field values.

Remember that the webhook is being invoked on behalf of the record that triggered the webhook workflow rule, so references to simple field values take values from the field values of that triggering record.

However, you can write any expression you wish including de-refs and any other expression.

Aha! Ok please advise on the field values. I have hard values in for the fields but need to have for example: UniqueID for the fav_id, Now() for CreatedAt, USEREMAIL() for createdBy etc, etc.

Can I use Drefโ€™s etc?

@Daisy_Ramirez

I have just added a new article describing how to do this.

See help.appsheet.com - Example: Copying Updated Records

Example: Copying Updated Records help.appsheet.com

@Daisy_Ramirez

I assume our messages crossed. See my answer just above.

ok got it. is the key value you mentioned earlier the key of the table reference on the work flow?

@Daisy_Ramirez

I think you are asking about when we turn an Add into an Update.

We do that when the key of the record you are trying to Add matches the key of an existing record in that table.

For example, letโ€™s say the key field of the People table is โ€œNameโ€.

Imagine โ€œuser1โ€ adds a record having the key value โ€œBobโ€ and โ€œuser2โ€ tries to add the same record at almost the same instant. Assume the sync from โ€œuser1โ€ arrives first, so we insert the record for โ€œBobโ€. Now the sync for โ€œuser2โ€ arrives a second later. We see that the record with key โ€œBobโ€ already exists, so we turn the add into an update. It as if the second user did an Update to โ€œBobโ€ rather than an Add.

In the enterprise database world (where we mostly come from) turning an Add (i.e. Insert) into an Update is called an โ€œUpsertโ€.

We are talking about letting you decide the conflict resolution policy for your app, but at the moment we always do an โ€œUpsertโ€ when this condition arises.

@Philip_Garrett_Appsh Got it - A million thank youโ€™s for all of your help!

@Philip_Garrett_Appsh Hi Philip, Iโ€™ve started work on my live tables and came across an error code for a field thatโ€™s not required - it failed a Valid_If condition. I have quite a few fields that are not required so its odd that this one was picked up. Hereโ€™s the error:

โ€œResultโ€: โ€œFailureโ€,

โ€œResultErrorโ€: โ€œError: Value โ€˜โ€™ in field โ€˜member_user_idโ€™ in table โ€˜tasksโ€™ having key โ€˜9ccead21โ€™ failed โ€˜Valid_Ifโ€™ condition.โ€,

โ€œRecordTypeโ€: โ€œStopโ€

@Daisy_Ramirez

Thanks for finding and reporting the problem Daisy.

If testing goes well the change will be released on Wednesday afternoon Seattle time.

@Philip_Garrett_Appsh Hi Philip, just sent an email reply as well.

Iโ€™ve configured as youโ€™ve outline above and received an API data is missing error. I then renamed columns so that both tables would match and got a success according to the audit logs but data is not being populated into the table. Can you assist? Iโ€™m sure its something straight forward I just canโ€™t see it. Thanks so much

@Philip_Garrett_Appsh 3rdArm-506404

@Daisy_Ramirez

I am confused by what I am seeing in the Audit History.

At 10/5/2018 5:39:56 PM

I see webhook rule โ€œfavorites_to_tasksโ€ being invoked but the body contains HTML rather than JSON.

At 10/5/2018 5:39:56 PM

I see the API being invoked. It reported that the โ€œAPI data is missingโ€. That makes sense because the body was not JSON.

At 10/5/2018 6:17:09 PM

I see the API being invoked again. It fails with the error โ€œAPI data is missingโ€. How is the API being triggered? I donโ€™t see the webhook being triggered at that time.

Can you do me a favor and create a simple test app with two tables and two or three records that reproduces the problem? That will allow me to copy the app and debug it.

@Philip_Garrett_Appsh ok I copied the text from step 8 of the document and replaced the field names with my field names.

8.Create a โ€œJSON Body Templateโ€ that looks like this:

{

โ€œActionโ€: โ€œAddโ€,

โ€œPropertiesโ€: {

โ€œLocaleโ€: โ€œen-USโ€,

โ€œTimezoneโ€: โ€œEastern Standard Timeโ€

},

โ€œRowsโ€: [

{

โ€œNameโ€: โ€œ<<[Name]>>โ€,

โ€œAgeโ€: โ€œ<<[Age]>>โ€,

โ€œDropDownโ€: โ€œ<<[DropDown]>>โ€,

โ€œCountโ€: โ€œ<<[Count]>>โ€

}

] }

Should I leave the JSON Body blank and let the JSON Body Template do the work?

How is the API normally triggered? I thought the WorkFlow was firing off the API when a change was made in the target table?

@Philip_Garrett_Appsh Hi Philip, Iโ€™m unfortunately still struggling with this one and want to make sure Iโ€™m able to use a webhook for the scenario below:

*I have a favorites list of items (task_favorites)

Iโ€™d like our users to maintain

*Once a week, theyโ€™ll pull up their favorites list and select the items they need

*All of the items selected should then be inserted into another table (tasks).

Iโ€™m familiar with the deep links that allow this to take place for a single record but is there a way to do this in bulk?

Iโ€™m using Google Sheets.

Thanks Philip

Top Labels in this Space