This article explains you below things
Create a simple button using data label and java script and show a sample alert on its click.
Step 1: Drag and Drop a data label on smart form.
Step 2: Now in Properties Set Literal property to true
Step 3: Navigate to Expression property click on ellipse button to add a new expression, copy below js script and click ok
Step 1: Drag and Drop a new Button Control.
Step 2: Add click event to the button added in Step 1, and add a rule to show message “Hello from Button Control”
Step 3: Now run the form and open developer mode (hit F12) and inspect the button element, copy the id of button that you have added in Step 1
Step 4: once you have the id, you need to modify the script of data label button as below.
**00000000-0000-0000-0000-000000000000_79af447e-1e21-9933-8152-588f18d59d72 has to be replaced with id you copied from step 3
That’s it, now when you click Data Label Button, you’ll see Button Control’s rules getting executed.
This is pretty much similar as above
Drag and drop a new dataLabel find its id using developer mode and replace the datalabel button script as below.
That’s it when you click data label button, you see the text of data label getting changed to “’Dynamically Set Text”.