Example Codes
Clothing Size
In this example, we use Execute JavaScript to send size recommendations to the client based on their weight and height. This functionality is especially useful for businesses working with clothing where clients have doubts regarding the most suitable size.
- First, in the automation flow, we request the client to provide their height and weight.
- Next, we save the client’s responses in the variables
payload.height
andpayload.weight
.
- In Execute JavaScript, we use the variables
payload.height
andpayload.weight
to calculate the client’s BMI and suggest the most appropriate size based on this information.
- Finally, the result of the code will be saved in the variable
payload.suggestedSize
, which is sent to the client in the last message indicating the suggested size based on their height and weight.