Help

Automation - Update Record - Invalid Input Error

Topic Labels: Automations
Solved
Jump to Solution
1224 5
cancel
Showing results for 
Search instead for 
Did you mean: 
Jon_Wright
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi all - I’m trying to run an automation using a 3rd party Webhook. When a new Post is sent live, or updated, in my WordPress site I want to send various bits of info about that Post to AirTable.

Everything works fine when I use ‘Create Record’ (so I know the webhook works) but obviously if I update the Post at any point it just adds it as a duplicate.

So what I want to do is use Update Record instead (I think?). When a new Post is created, add it to AT, if that post is updated, update the record in AT.

However - my understanding from this post Update record action failing (error: received invalid inputs.) - #3 by Brian_Nana-Sinkam, given what @Kamille_Parks says, is that I can’t use a Record ID from my Webhook e.g. Post_GUID. I need to use the AT Record ID. Which I don’t have available it seems.

Screenshot 2022-10-07 at 18.30.40

Is the only way around this to run the script that Kamille posted or am I missing something? Seems like a weird ‘feature’ if AT designed things this way, so I’m hoping I’m misunderstanding something.

1 Solution

Accepted Solutions
Kamille_Parks
16 - Uranus
16 - Uranus

It may be the conditions set on the various actions

It looks like your Find Records step is looking for records where {Post GUID} is not the same as the webhook. Shouldn’t that be {Post GUID} = (or contains) webhook GUID?

Your first conditional step’s condition would be “if [Find Records > List Properties > Length] = 0”

Your second conditional step’s condition would be “if [Find Records > List Properties > Length] = 1”

See Solution in Thread

5 Replies 5

When you’re transferring data from the webhook, is there some unique identifier that you could use to fill in a different field? Wordpress posts should have a Post ID, so I would create a field in your table that your automation inserts this ID.

Now the precise implementation will depend on a few factors. Is your webhook called only when a post is created, and a different webhook is called when one is updated? If not, is the webhook called when a post is either created or updated?

If its two separate webhooks, create a separate automation that begins with a Find Records step that searches the Wordpress Posts table for any record with matching Post ID values. Add an Update Record step after it that uses the List of Record Ids (if only one matching record is found you’re good, if more than one is found you’ll get an error. You could make this a conditional action where the condition is “exactly one matching record is found”).

If its a single webhook, alter your automation to begin with the Find Records step as described above. Then create conditional action steps where one’s condition is (Find Records found 1 matching record), and add the Update Record step as described above. In another conditional action, make its condition (No Found Records) and add the Create Record step you probably already have in your existing automation.

I don’t believe you need a script.

Hi Kamille - Thanks for the response but you have lost me there a bit, so hoping you can clarify.

I have a single webhook that is called on both post creation or post update. In my AT table I have both Post ID & Post GUID, I want to use Post GUID as it will be unique across multiple blogs (Post ID isn’t). My table currently has no data in it, I haven’t pre-populated it with existing posts.

Here are my screenshots of me attempting (badly) to implement what you’re saying:

1- Find Records

2- Update Record

3- Create Record

I think where I’m getting most confused is the ‘conditional actions’ parts of your response. I can only see the option for conditionals on the Find records action type, not the others.

Jon_Wright
5 - Automation Enthusiast
5 - Automation Enthusiast

@Kamille_Parks - Sorry, I think I’ve kinda worked out what you mean now (now I’ve spotted the conditional actions section in the UI). This is where I’ve got to. The last step, update record, is still causing me issues though.

Screenshot 2022-10-07 at 22.09.21

Kamille_Parks
16 - Uranus
16 - Uranus

It may be the conditions set on the various actions

It looks like your Find Records step is looking for records where {Post GUID} is not the same as the webhook. Shouldn’t that be {Post GUID} = (or contains) webhook GUID?

Your first conditional step’s condition would be “if [Find Records > List Properties > Length] = 0”

Your second conditional step’s condition would be “if [Find Records > List Properties > Length] = 1”

Thanks for all your help Kamille, I think I’ve (you’ve) cracked it.