- Go to UI Canvas > Variables > Data Variables
- Add 2 data variables: A_ProductBasicText and Customers
- Select SAVE
Note: Please make sure that you have same data variable names in your screen: A_ProductBasicText1 and Customers1
- Select Customers1 data entity. Select the [X] icon under Filter condition.
- Select Object with Properties
-
Add a condition:
-
Property: customerNumber.
-
Condition type: equal.
-
Select the ‘123’ icon under Compared value
-
- Go to Formula > Select into the Formula field
- Enter the formula below and Save the formula afterwards
INTEGER(params.SelectedCustomerNumber)
- Save the condition
-
Switch to VIEW.
-
Drag & Drop the UI Components with the following order:
-
Dropdown field
-
Input field
-
Button
-
-
Switch to VARIABLES > PAGE VARIABLES >
-
Create 2 Page Variables
-
Variable 1: Name: PurchaseValue Variable Value type: number
-
Variable 2: Name SelectedProduct Value type: text
-
-
Select Save
-
Switch back to VIEW then:
-
Select Dropdown field.
-
Rename the Label text: Select Product.
-
Select the ‘[ ]’ icon under Option list.
-
-
Go to Formula
-
Enter the formula below
MAP(data.A_ProductBasicText1, {label:item.Product, value:item.Product})
- Save the Formula
-
Select the X under Selected value
-
Go to Data and Variables > Page variable > SelectedProduct > select Save
-
Select Input field and Rename label: Purchase Value
-
Select the ‘X’ icon under Value
-
Go to Data and Variables > Page variable > PurchaseValue
-
Select Save
-
Select Button > Rename label: Add Points!
-
Open Logic Canvas
-
Drag & Drop the logic components below to create the logic and join each component.
-
Create record
-
Alert
-
Navigate back
-
-
Select Save
-
Select Create record function > Select the data entity Purchases and Save.
-
Select the Custom Object
-
Select the ABC icon under ID > Formula
-
Select the Formula bar.
- Enter the following formula and Save:
GENERATE_UUID()
- Select the [X] icon under customer_ID > Formula > Create formula
- Enter the following formula and Save:
data.Customers1[0].ID
- Select the [X] icon under purchaseValue > Formula > Create formula
- Enter the following formula and Save:
INTEGER(pageVars.PurchaseValue)
- Select the [X] icon under selectedProduct > Data and Variables > Page Variable > SelectedProduct
- Save the window
- Select Alert component > Select the ABC icon under Dialog title > Formula
- Copy and Paste (as plain text) the formula below > Save
data.Customers1[0].name + " has successfully earned " + outputs["Create record"].response.rewardPoints + " points!"
- Save the project