DBC: Chili - Commonly Used Actions
None Action
Since DB Commerce doesn't support the "Include an Empty" option, this action is used to create the option of None to the end user.
- Create your variable and set as Type: List
- Make sure whatever value you use in the list matches what you will enter in the action. This is case sensitive so None and none will not be considered the same.
Add the following "On Change" action. In this example the action is applied to the variable Country.
if > variable > YOUR VARIABLE HERE > displayValue >blank dropdown box > is > string > None
set > variable > YOUR VARIALBE HERE> value > = > string > blank text box
end if
Variable Separator Action
This separator action can be used, for example, to separate phone numbers like mobile and office. The separator will appear when both variables are in use, and it will automatically be removed if only one variable is present.
Create a new variable, Separator (or whatever you choose)
You will do this so we can apply an action that will show the separator when both values are present, but removes it when one isn’t since neither variable is mandatory.
- This variable will be hidden so make sure to uncheck the visible option
In this example, apply the following action to both the Mobile and Office variables. This is saying if variables Mobile and Office are not blank, add the separator else don’t show it.
Go to Edit Story for the frame that contains these variables so it reads as %Mobile%%Separator%%Office% (or whatever variable names you are using for mobile and office)
- With the new variable and action in place if both variables have data this separator will show or if one of the variables doesn't have data this variable will automatically be removed.
Company Profiles with Image Action
This company profile with image action can be used when you want to pull an image into a company profile. The action will show the image based on a users company profile selection.
- Upload the images you will use for the company profile within Chili Backoffice
- You will create two variables in back-office. In this example we will be pulling an employee photo into the company profile.
Create an image variable called employee_image
Create a short text variable called employee_variable
On the employee_variable apply the following "On Change" action:
set > variable > employee_image > imagePath = string >FILE PATH LOCATION TO PULL IMAGES FROM STEP 1 (ex: 00-DEM01100/Employee Photos/) > & > variable > employee_variable > displayValue > blank dropdown box
set > variable > employee_image > imagePath - is saying for variable employee image, show an image from this directory
& > variable > employee_variable > displayValue - is saying when you select this company profile for the employee_variable show the image associated within the company profile (Step 8 below)
- Save your document
- Go to Cust Admin > Work with Profiles
Open the profile you are using and add the variable, employee_variable. The short text variable is added here so the file name can be added and the action know what image to pull.
- Save
- Go to Set Values
Open each values and add the file name to the employee_variable. These files are located in your backoffice in the directory you noted in your action (Step 5 above)
- Save
- View the company profile online and image for that profile should pull as expected