Actions

 

Keep your application secure.Remember the Snap rules you write for your configurator or scene are executed in one of two places: either server-side within the cloud, or client-side within the user's browser.  Consider the best location to balance needs for security and speed.Server Side
Server-side code is executed on the server, and the results sent to the client. The Snap code itself is never sent to the user's device for execution. Server-side code is best for any proprietary calculations or patented, sensitive lookups. However, network latency does make this code slower.
Examples: pricing rules, workflow rules, safe functions, global functions.Client Side
Most other code is processed within the web browser on the user's device.  Local to the user with no network latency, client-side code is fast and responsive.  However, it is not as secure: some users could expose the logic or comments within the rule, as they can with any client-side javascript.  Local rules are the best place for code which runs often, needs to be fast, and does not contain sensitive calculations or comments.
Examples: configurator rules, scene rules, global rules, etc.You can easily mix and match your code, placing sensitive functions on the server and other code locally. Learn more about where Snap rules are executed.

 

On a mobile screen, actions are collapsed under a hamburger menu.


Add an Action

To add an action to the configurator, select the 'Actions' node in the tree, and click on the '+' button.  Once you have added an action, snap rules can be added to the action by selecting the action in the tree and clicking the '+' button.

Migrating from an Action to a Button

To migrate code from an action to a button, you can copy and paste the json of the Snap code from the action's workspace to the button's workspace.

Action Properties

Property Description
Name The name of the action. This is also the text that will show in the button in the running configurator.
Icon An icon that will show up in the action button in the running configurator.
Visible

Specifies whether the action button is visible in the running configurator.

Was this article helpful?