Copy/Paste and Template Functionality
How to duplicate, copy and paste rules and work with rule templates on the new rule engine.
Last updated
How to duplicate, copy and paste rules and work with rule templates on the new rule engine.
Last updated
You can easily copy and paste rules within your workspaces. This feature simplifies the process of replicating configurations, saving time and effort.
See everything covered on this video:
Navigate to the Rule Engine: Select the rule you would like to replicate. Ensure the rule is configured with the triggers, conditions and actions (e.g., Webhook, Email notification) as needed.
Hover to Access Copy/Paste Option: Hover over the button "More", next to the Enabled switch on the right corner. You will see the options to Copy rule configuration and Paste rule configuration.
Select a Target Workspace: Before pasting the rule, ensure that the target device for the rule exists within the workspace where you want to paste the rule. If not, claim the device in the workspace.
If you don't have access to the product or device, you can still copy and paste the rule and reuse conditions and actions, such as email templates, webhooks, etc.
Paste the Rule:
Go to the target workspace’s Rule Engine.
Click Add Rule and select Paste rule configuration instead of manually configuring a new rule.
The copied rule will be pasted with the original trigger, condition, and action.
Customisation Options:
When pasting, you will have the option to replace certain elements. For instance, you can deselect actions or triggers if you want to configure your own actions.
You can modify details like the recipient in an Email action or other specifics based on your needs.
Enable and Save the Rule: After making any necessary adjustments, enable the rule and save it. Your copied rule is now active and ready to use.
One of the advanced features of the Copy/Paste functionality is the ability to work with the rule’s JSON structure. When copying a rule, you can see the JSON representation on your clipboard, which contains all the rule’s configuration data.
You can:
Save the JSON externally for future use, creating reusable templates.
Modify the JSON to make changes like swapping out email recipients or adjusting triggers without needing to reconfigure everything from scratch.
This provides a powerful way to manage and distribute rule configurations, especially when working with multiple devices, workspaces or complex setups.
Rules in the Datacake IoT platform are represented as JSON objects. By copying and modifying these JSON structures, users can create reusable rule templates.
Rule templates can be shared across workspaces, making it easy to replicate rules for multiple devices or projects without needing to recreate them from scratch.
Analyze the JSON Structure:
Each rule’s configuration can be viewed and modified using the JSON format. Understand the structure and identify fields that need to be adjusted, such as triggers, actions, and product identifiers.
Modify and Save as Template:
Make necessary changes to the JSON configuration and save it as a template for future use.
Importing a Template:
When creating a new rule, paste the template’s JSON configuration and adjust any product-specific fields as needed.
When using templates across different workspaces, ensure that the product fields are appropriately configured, as products might differ between workspaces.
Templates can be shared with other users or within different workspaces by copying and pasting the JSON configuration.
The rule engine’s JSON configuration allows for detailed customization of rules. Documentation is available with explanations of different JSON tags and their meanings.
By utilizing JSON configurations, users can fine-tune rules, automate processes, and create sophisticated automation strategies.