Global Action: Set a value in the Arigato Database for any resource
The Set a Value in the Arigato Database for any Resource Action allows users to store data in the Arigato Database. This data can later be retrieved in Workflows for Conditions, Actions, or within Twig code.
Configuring the Action
Field Name | Description |
---|---|
Resource Type | The type of Shopify resource to associate with the Arigato Database value. Determine if the value is global or connected to a specific resource like an order or product. |
Resource ID | The unique identifier for the resource if setting data for a specific resource. |
Key | The identifier used when retrieving this data. Must be unique within the scope of a single resource or globally if using 'Shop (Global)'. |
Value | The content to save in the database. This value can be static text or a dynamic value using Twig code. |
Using the Data
To retrieve the value that has been set, use the Token formatted as follows. Replace resource_type
with your 'Resource Type', and key
with your 'Key'.
{{ resource_type.database['key'] }}
Example
To store a custom 'lead_time' in the Arigato Database for a product, use 'Product' as the Resource Type, {{ product.id }}
as the Resource ID, lead_time
as the Key, and the desired number of days as the Value.
Viewing, Editing & Manually Setting Data
In the left sidebar of the app, click Storage to search for values based on a Resource Type, Key or Value. Click Create to manually add an entry.
Use Cases
This Action is designed to work around the API limitations of Metafields, by acting as a rapid method for Workflows to save and access information.
For example, consider a scenario where certain an Action within a Workflow that is intended to execute only once for a given item. This Action allows for setting a marker on the item, such as "has_run: true". Subsequently, a Condition within the Workflow checks for this marker. If the marker indicates that "has_run" is not "true", the Action is run. If it is "true", it signifies the Actions has already been completed, preventing a repeat occurrence. This ensures each item undergoes the process only a single time.
Custom Actions
You can also use this action within a Custom Action. To do so, generate the required payload with the specified key-value pair. See documentation.