younifyd
Menu

Add Or Update Documents

Add or update many documents in one step. Each is matched on its own key, so sending one again updates it.

Use it in a workflow

  1. Add a step and choose the Search connector.
  2. Pick the Add Or Update Documents action (under database).
  3. Fill in the fields below, then reference the result from later steps as {{addOrUpdateDocuments.response.data}}.

Fields

indexSlugstringrequired

The search index to write into, by slug. Can also be a variable, e.g. {{variables.indexSlug}}.

documentsstringrequired

A JSON array of documents, or one object. Pointing this at a webhook body with {{trigger.body}} works as it is. Each document uses the index's fields, for example {"id":"p1","title":"Trail shoe","variants":[{"sku":"p1-a","color":"black","size":"M"}]}.

Examples

Sync a page of products

A document with a problem is reported in errors and the others are still saved

json
{
  "indexSlug": "products",
  "documents": "[{\"id\":\"p1\",\"title\":\"Trail shoe\",\"variants\":[{\"sku\":\"p1-a\",\"color\":\"black\",\"size\":\"M\"}]}]"
}

Need more? See the Search guide for connection setup and behaviour shared by every action.