Appearance
Add to Store
The Add to Store node adds an item to a named user data store for the current user. User stores are per-user collections used for features like favorites, bookmarks, wishlists, and saved items.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
storeName | string | -- | Required. The name of the data store (e.g., favorites, wishlist). Only lowercase letters, numbers, and underscores are allowed. |
itemId | string | -- | The item ID to add. If empty, the node extracts id or item_id from the input data. |
Input
Accepts any data type. If itemId is not configured, the node looks for id or item_id in the input.
Output
Returns the input data with _stored: true added on success.
json
{
"id": 42,
"name": "Widget A",
"_stored": true
}If not logged in:
json
{
"_valid": false,
"_errors": [{ "field": "_auth", "message": "Login required." }]
}How It Works
- Gets the current user ID. Returns an error if not logged in.
- Sanitizes the store name.
- Resolves the item ID from config or input.
- Executes
INSERT IGNORE INTO nexus_user_stores (user_id, store_name, item_id). - The
INSERT IGNOREprevents duplicate entries -- adding the same item twice is a no-op.
Example Use Cases
Add to favorites
storeName: "favorites"
itemId: "`{ {input.id}}`"Wishlist button action
Context --> Require Auth --> Add to Store (storeName: "wishlist") --> OutputSave for later
Context --> Add to Store (storeName: "saved") --> OutputTIP
Pair with Remove from Store for toggle behavior.