top of page
Update Single Wix Collection Item Fields with an HTTP Request from Make.com, n8n or any automation platform

Update Single Wix Collection Item Fields with an HTTP Request from Make.com, n8n or any automation platform

Learn how to simplify Wix Data updates from automation tools like Make.com, n8n or Zapier using a secure function that updates only specific fields—no need to pull and merge existing data.

The problem: When using Wix Data update, you must ensure that when pushing the update, you include every field in the collection item, including the one you have updated.


Show and Tell of How this Function Works for updating Wix Collections

This becomes a bit of an issue, we felt, when orchestrating changes using automation platforms for example when running complicated make.com, n8n, zapier—insert your automation tool here—scenarios.


Where we access different services and AI models to do something like the scenario below, which uses BigQuery, Openai, and Google Gemini to create a semantically relevant further reading block for your content, which is continuously updated as new content is added.



Workflow diagram with various colored icons: Webhooks, Google BigQuery, OpenAI, JSON, Google Gemini AI, and Data store connected by arrows, on a white background.
Example of Make.com Scenario Calling The Update Function At the End

At the end of the scenario, to update just the fields you have changed, you would have to fetch all the fields in an item (adding extra complexity and maintainability issues to your scenario) and make sure you push them all into WIX.


This function simplifies all of that and lets you send only the updated fields in a JSON object like the example below at the end of a Make.com scenario:


{
    "collectionName": "yourCollectinId",
    "itemId": "itemID",
    "updates": {
"furtherReadingBlock": "{{2.furtherReadingBlockInfoFromYourMakeScenario}}"

    }
}

This function allows external services (like Make) to securely update specific fields of a Wix collection item via an HTTP request.


It supports various field types with a simple prefixing convention to handle data safely and automatically.


You can grab it from GitHub


A brief overview of what the code does


Authorization:

Before processing, the function checks if the request is authorised using a custom isPermitted() check. You can modify this logic to match your security model (e.g., API keys, session tokens, etc.).


Request Structure:

Endpoint:

POST /_functions/updateItemField


Content-Type:

application/json


Example Payload:

{
  "collectionName": "exampleCollection",
  "itemId": "abc123",
  "updates": {
    "textField": "Updated text",
    "safebool_isPublished": "true",
    "refs_tags": ["tag1", "tag2"],
    "date_publishedAt": "2025-04-19T12:00:00.000Z"
  }
}

Interested in going deeper? Check out our resources and courses.

Related Content

More information on integrating Wix with external services can be explored in the following content. These articles provide step-by-step guides on connecting Wix to n8n and Make.com, enabling secure field updates and automated workflows, extending the functionality discussed in this article.

How to add the code to your Wix site and use it

The steps below will walk you through using a custom HTTP function on your Wix site to update specific fields in a database collection, without accidentally overwriting existing data.


This guide is beginner-friendly and requires no prior coding experience, though it helps to be familiar with your Wix site’s Content Manager and Dev Mode (Velo).


🔧 What This Does

This function lets you:

  • Update specific fields of a collection item remotely (e.g., from Make.com, n8n, or another service)

  • Avoid overwriting existing data unintentionally

  • Handle special fields like dates, booleans, and multi-reference fields

  • Secure the endpoint with a secret key


📁 Step 1: Add the Code

  1. Go to your site in the Wix Editor.

  2. Enable Dev Mode (if it’s not already on).

  3. Open the backend/http-functions.js file.

  4. Paste the entire code snippet provided below into that file.

📝 If you already have functions in http-functions.js, just add this one at the bottom.


🔐 Step 2: Add a Secret Key

This function is secured using a key stored in Wix Secrets Manager.

  1. In your site dashboard, go to Settings > Secrets Manager.

  2. Add a new secret:

    • Name: my_secret

    • Value: any strong string you want to use as your key (e.g., abc123!@#)

When sending requests, include this key in the HTTP headers using either:


{
  "authorization": "abc123!@#"
}

Or

{

  "auth": "abc123!@#"

}

API configuration screen showing a POST request setup. Fields include URL, Method, Headers with "auth" name, and Body type as Raw JSON.
Example HTTP Module Set Up in Make.com


🌐 Step 3: Understand the URL

The function is accessible via a URL like this:


https://yourdomain.com/_functions/updateItemField


Replace yourdomain.com with your actual Wix domain or custom domain.

You can use this URL in tools like Make.com, n8n, Zapier, or any service that can send POST requests.


Understanding the base URL for your use case is documented here:

https://dev.wix.com/docs/velo/velo-only-apis/wix-http-functions/wix-http-function-request/base-url


📦 Step 4: Example Request Payload

Here’s an example of how your request should look:


{
  "collectionName": "BlogPosts",
  "itemId": "1234567890abcdef",
  "updates": {
    "title": "New Blog Title",
    "date_publishDate": "2025-04-30",
    "safebool_isPublished": "true",
    "refs_categories": ["cat1", "cat2"]
  }
}


🧠 Prefix Conventions & Supported Field Types

Prefix

Use For

Example Value

Example Structure

Notes

(none)

String, Number,

Single Reference

"Hello", 42

"Title" : "Your Title"

Direct assignment

safebool_

Boolean (safe)

"true", 1, "1", true

safebool_isPublished: "true"

Converts strings/numbers into true booleans

date_

Date

"2025-04-19T00:00:00Z"

date_publishDate: "2025-04-19T00:00:00Z"

Converts to a JS Date object

refs_

Multi-Reference

["id1", "id2"]

refs_categories: ["id1", "id2"]

Note: the field ID should match the id's in your collection item ,add the prefix to handle the field types above


What The Function Does Behind the Scenes

  • Fetches the existing item

  • Merges in only the updated fields

  • Converts and sanitises special types

  • Uses replaceReferences for reference fields

  • Returns a success or error response


Limitations

  • This function does not support image fields or rich text fields yet!.

  • You'll need a separate function if you want to update images.



🛠️ Full Code

Get The Full Code from GitHub

This link is publicly accessible. We have not added the code to this post because more extended code snippets are increasingly difficult to copy and paste into the code block in Wix Rich Content Editor.


📌 Tips for Using with Make.com

  • Use the HTTP Module with POST method

  • Set the header authorization or auth with your secret key

  • Send the body in JSON format and in the example below.


Full Example Set Up of Make.com Http request module
Full Example Set Up of Make.com Http request module

bottom of page