Conditional Branch (Labeling Logic)

In this article we will explain how to achieve conditional branch in AForms with concrete examples. How do you do it? Attach a label on the user.

AForms uses an individual way, called “Labeling Logic”, to achieve conditional branch in automatic quotation.

The basic idea is “When a user does something special, attach a label on him/her”.
Then, “The form controls the components by looking at the labels attached to the user”.

It would be easier to explain with actual examples, so here are some examples.

Case 1: To provide an additional option in a later item only to users who selected a specific option

For example, in the customization form of a BTO PC like Dell’s, the logic is that only users who choose Windows 10 Pro can select 32GB memory.

In this case, set up the form so that if a user chooses Windows 10 Pro as OS, AForms will attach the label “pro-edition” to the user.
Then, when selecting memory, only if the user has the “pro-edition” label, they can choose 32GB memory.

To actually create a form in this way, enter “pro-edition” in the “Label” field of the Wondows10 Pro Option.
Then fill in the “Required Label” field of the 32GB memory Option with “pro-edition” again.

Case 2: To give a discount to users whose quoted price is above a certain amount

In this case, please use “Price Watcher” item.
The Price Watcher is a component that monitors the quoted price and attach a label to the user if it meets the specified criteria.
For example, if the quoted price is more than $1,000, the “large-price” label can be attached.

To add a details line to the quotation only when it has a specific label, you need to use “Auto Item” with “Required Labels”.
For example, the name could be “Discount”, the price could be “-50”, and the Required Labels field could be “large-price”.
Then only the users labeled “large-price” can have the $-50 details line added in the name of the discount.

Labels and Components

This information is current as of AForms 1.2.11.

Components that can be used to attach labels

Components that can be controlled by labels

Also, if you write more than two labels in the “Required Labels” field, the condition will not be fulfilled until all of them are attached to the user.

Label specifications

0 0