Still having trouble with some webhook workfl...

Still having trouble with some webhook workflow using Zapier. My rent received table columns are populated by Zapier from my table Property. I basically copied the attendance app. When I use action Rent Received I get a single row created as it should (with exception of ID and Amount Received column, which I will refer to soon), however if I then use action Rent Not Received, which sets it the column in Property table to false, it first repeats the โ€œYโ€ followed by the โ€œNโ€ rather than just โ€œNโ€ as in the screenshot. Any ideas??

Regarding the ID and Amount Received columns, much like the attendance app my ID column uses UNIQUEID() in initial value, however it does not populate - is this because entrys are direct to spreadsheet and not via app? how does attendance app get around this or does it copy the uniqueid from the parent table? And my amount received expression is =IF([Rent Received]=โ€œYโ€,[_THISROW].[Rent Amount],โ€œ0โ€)

in the Appformula fieldโ€ฆ However this does not work, again is this because the data is not created through the app but rather directly in the sheet and if so, how does the attendance app achieve it?

*refer to unit 3 & 2 in pciture. This was โ€œRent Receivedโ€ x 1 and โ€œRent Not Receivedโ€ x 1 for each unit, as you can see 1 x extra โ€œYโ€ created when โ€œRent Not Receivedโ€ action performed

Thank you.

0 16 1,248
16 REPLIES 16

@William_Stewart

I am not sure I follow, but I wonder if you could have the webhook call the API directly as described here help.appsheet.com - Example: Copying Newly Added Records

Having โ€œone less moving partโ€ might make things easier.

Example: Copying Newly Added Records help.appsheet.com

Thanks @Philip_Garrett_Appsh, I will give this a go. I didnt realise it was an option, but yes agree, the less moving / external parts the better!

Would the whitespace in my webhook URL be causing the error โ€œURL not well formedโ€? This seems to be the only error now.

@William_Stewart

i.e Rent Received instead of RentReceived? My table name does have the space but I can change if need be, obviously I would rather avoid this as I would need to change all table references too.

@William_Stewart

We should probably handle a white space but that will take time. Can you remove the white space from the table name for now? Sorry for the hassle.

@Philip_Garrett_Appsh Removing the whitespace did result in success, however it did not result in the row being added in the table. Is this now because I am on a Free plan?

@William_Stewart

What does the Audit History say as described here help.appsheet.com - Troubleshooting API Calls

Troubleshooting API Calls help.appsheet.com

{

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

โ€œAppIdโ€: โ€œf30c709c-224b-43f2-90ff-2fcd917618f2โ€,

โ€œTableNameโ€: โ€œRentReceivedโ€,

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

โ€œResultErrorโ€: โ€œREST API REST API invoke request failed: API data is missing.โ€,

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

Unsure which API data it is referring to.

@William_Stewart

I just published the article yesterday. Hope it helps!

@Philip_Garrett_Appsh actually - looking at the article this is only to copy newly added rows? I am using Zapier to copy certain columns when an already existing row is updated (i.e. when Date changes) Can the method you describe be trigged on updates? thanks

@William_Stewart

Yes, it is essentially the same.

  1. Trigger the webhook on any Update to the table you want to monitor for changes. 2. Change the โ€œActionโ€ in the Post body to โ€œEditโ€. 3. You only need to include the key fields and those fields you wish to update in the Post body. Fields you omit from the Post body are unchanged.

@Philip_Garrett_Appsh Thanks. I canโ€™t seem to get this working. Using template: {

โ€œActionโ€: โ€œEditโ€,

โ€œPropertiesโ€: {

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

โ€œTimezoneโ€: โ€œNew Zealand Standard Timeโ€

},

โ€œRowsโ€: [

{

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

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

โ€œRent Receivedโ€: โ€œ<<[Rent Received]>>โ€

โ€œRent Amountโ€: โ€œ<<[Rent Amount]>>โ€

}

] }

I did made the template in Textedit and set to plain text to save as .JSON. Other details are correct from what I can tell. Nothing showing errors. Any where I should pay attention to?

@William_Stewart

Can you provide: 1. Account id 2. App name 3. Workflow rule name

I am seeing errors in Audit History for rule โ€œRent RCVD Webhookโ€. I assume that is the rule in question.

Go to Manage > Monitor > Audit History. Then look for entries for that rule.

@Philip_Garrett_Appsh

  1. 708906 2.Property Management App 3. Rent RCVD Webhook

Doesnโ€™t seem to be triggering the webhook from what I can tell. Also, I have just seen that the time is not reflective of current time zone, seems to be 13 hours behind (daylight saving here). But the time zone is definitely set on NZ standard time. Should I be using UTC+12 instead?

@William_Stewart

I looked at your most recent invocation of the rule โ€œRent RCVD Webhookโ€.

It occurred at 10/5/2018 8:07:46 AM UTC in the Audit History as the result of an update that occurred at 10/5/2018 8:07:32 AM UTC.

UserId: 708906, EventTimeStamp: 10/5/2018 8:07:46 AM +00:00, TraceId: 74840360-f488-4475-a0b8-cf2893c3245c, AppTemplateName: โ€˜PropertyManagementApp-708906โ€™, TableName: โ€˜Propertyโ€™ Properties

AppTemplateName: โ€˜PropertyManagementApp-708906โ€™

AppId: โ€˜f30c709c-224b-43f2-90ff-2fcd917618f2โ€™

AppTemplateVersion: โ€˜1.001352โ€™ Using version 1.001352 rather than current version 1.001382

RuleName: โ€˜Rent RCVD Webhookโ€™

EventType: โ€˜Changeโ€™

Operation: โ€˜Change workflow ruleโ€™

RuleEvalMode: โ€˜Productionโ€™

TableName: โ€˜Propertyโ€™

RuleTableName: โ€˜Propertyโ€™

OperationUpdateMode: โ€˜UPDATES_ONLYโ€™

EventMatch: โ€˜Workflow event successfully matchedโ€™

Condition: โ€˜โ€™

MatchesCondition: โ€˜Trueโ€™

Actions: โ€˜Created 1 Actionsโ€™

Url: โ€˜https://api.appsheet.com/api/v1/apps/f30c709c-224b-43f2-90ff-2fcd917618f2/tables/Rent Received/Actionโ€™

Verb: โ€˜Postโ€™

Headers: โ€˜applicationAccessKey:Vaโ€ฆโ€™

Payload: โ€˜โ€™

Errors: 'Error: The webhook url โ€˜https://api.appsheet.com/api/v1/apps/f30c709c-224b-43f2-90ff-2fcd917618f2/tables/Rent Received/Action is not well formed Error: Workflow rule โ€˜Rent RCVD Webhookโ€™ โ€˜Bodyโ€™ template properties could not be obtained due to Accessing deleted file โ€˜Rent RCVD Webhook_BodyTemplate_20181005_025112.jsonโ€™โ€ฆ Error: Workflow rule โ€˜Rent RCVD Webhookโ€™ โ€˜Bodyโ€™ template could not be read due to FileMimeType โ€˜โ€™ is unexpectedโ€ฆโ€™

Warnings: โ€˜Warning: App version 1.001352, which is the latest version, is not marked deployable so the web hook is not being invoked. This web hook would have been posted to โ€˜https://api.appsheet.com/api/v1/apps/f30c709c-224b-43f2-90ff-2fcd917618f2/tables/Rent Received/Actionโ€™.โ€™

Result: โ€˜Failureโ€™

It has a number of problems listed in the audit record.

I suspect that at some point you replaced the Body Template with a new one but you have not gone back to your workflow rule and updated it to refer to the latest Body Template file. Instead, it appears to be referring to an older version of the file that you have deleted. Be aware that Google refers to files by their Doc Id, not their name. If you replace a template file it will have a new Doc Id. You must go back to the AppSheet Editor and update the JSON Body Template to ensure it refers to the latest template file.

Do this by: 1. Opening the webhook workflow rule in the editor. 2. Clicking the icon at the far right of the โ€œJSON Body Templateโ€ and selecting your current JSON body template file.

It appears that at some point you updated rule โ€œRent RCVD Webhookโ€ to be triggered on โ€œADD_ONLYโ€. You have not added any records to table โ€œPropertyโ€ recently, so the rule is not being triggered.

You app is not deployed, so the webhook will not be invoked.

I suggest you fix these problems and then try the rule again. When you do that, wait a minute or two for the rule to show up in Audit History. Then see what the Audit History tells you. Using the Audit History is the best way to diagnose problems. That is exactly what I do.

We do not adjust dates or times based on the Timezone in Properties. We simply use the Date and DateTime values you specify when we add or update the record.

In one of your JSON Bodies, you specified the expression UNIQUEID(). If you are adding a record with a key that specifies an InitialValue of UNIQUEID() , you should omit the field from JSON. We automatically initialize the key field based on its InitialValue. This is explained in this

paragraph which says:

Each individual Row value must normally include the key field values of the record to be added. However, if the key field contains an โ€œInitial valueโ€, you can omit the key field value. For example, you should omit the key field value when the key field has an โ€œInitial valueโ€ of UNIQUEID() or RandBetween(). The system will initialize the key field to the โ€œInitial valueโ€.

See this article https://help.appsheet.com/integrations/api/adding-records-to-a-table

@Philip_Garrett_Appsh Thanks for the detailed response. I think you will have seen some old errors, as far as I can see it should be using a recent template. I had tried with on update workflow instead of added. Uniqueid was also removed in the new template. I assume this means that it is not working because it is not deployed. This said, how come my Zapier was working? - this invokes the same workflow, so why would it be working when my app is not deployed? Further, I hadnโ€™t realised workflows were limited to paid plans - is this the case even if I am just using the app for myself? Thanks for all your time, I really appreciate your help.

Top Labels in this Space