Streaming live at 10am (PST)

How to edit Reference field with API (PATCH)?

Hi,

I connect Airtable with Webflow by Integromat. On Webflow I have two collections:

  • Changelog
  • Changelog Categories

Zrzut ekranu 2022-01-7 o 21.33.37

In Changelog collection I call Changelog Categories as a reference field.

I create a new item in Changelog collection. I can’t add a new item with Reference filed already set in Create Item action in Integromat. I need to update this field later with API call. I tried to do it like on docs: Webflow CMS API Reference but i get an error


I tried to update this field with Postman but I can’t see the reference field: category-reference on body. I can’t edit this item with PATCH also.


Any idea how to do it properly?

Hey @mkukulka

So multi-reference fields are arrays. This means they need to be wrapped by square brackets with each item wrapped in quotes then separated by commas. Like this.

"category-reference": ["Payments", "Another Item", "A third item"],

@jakespirek has a good video about using multi-ref fields for Webflow using Integromat. Hope that helps.

You have in mind multi reference. But what about just a reference? Is it possible to edit?

The easiest way to figure out how certain fields are rendered in the API is to populate one in the designer and then fetch it in Postman.

1 Like

Hey @mkukulka !

When you create a new item in Webflow through your scenario, do you come back to Airtable to add the Webflow ID of each newly created item in your database ?
This is essential if you want to automatically link items through reference fields later on, since reference fields will only accept the Webflow ID of the element to be referenced, not their Name/Title.

And when I look at the body of your custom API request, it seems that you are using the Name of the Category Reference (so “Payments”), instead of specifying its Webflow ID (which should probably come as a variable from a previous step), and that could also explain the error you’re getting from Webflow.

However, I don’t think you need to do a custom API call for that, it seems to me like you could do it all with the regular modules. I’m just not sure I understand why wouldn’t you be able to add a single ref item when you use the “Create a new item” module, could you please elaborate on that ?

Yes, I have connected ID’s from Airtable to Webflow items by ID and store it on the Integromat database.

And when I look at the body of your custom API request, it seems that you are using the Name of the Category Reference (so “Payments”), instead of specifying its Webflow ID (which should probably come as a variable from a previous step), and that could also explain the error you’re getting from Webflow.

Good point. But it generate errors too :frowning:

However, I don’t think you need to do a custom API call for that, it seems to me like you could do it all with the regular modules. I’m just not sure I understand why wouldn’t you be able to add a single ref item when you use the “Create a new item” module, could you please elaborate on that ?

The easiest solutions are the best :wink: Just paste Category ID to Integromat on Create Item flow and it works. Thank you @PierredeMontalte

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.