|
Navigation: Action Items > SQL Action Item > SQL Examples Step by Step > SQL Example 1 |
![]() ![]()
|
See Also: Create New Action Item; Dynamic Action Item; Create SQL Action Item; Executing Action Items; Scheduled Action Items; Example 2; Example 3; Merge Module Action Items
(Click Topic to view more info. Click Back button to return to here).
Pretend you accidentally entered 50 of your contacts' street addresses into the "Address2" Field (on the 2nd tab of the Page Box Control ) instead of the "Address1" Field where you want them to be because the rest of your contacts' addresses are there. So, you need to have ContactTalk change "Address1" to be "Address2" on those 50 contacts.
Step 1: Follow the instructions for Creating a New Action Item and select SQL from the drop down list. |
![]() Action Item Type Drop Down List |
Step 2: The Build SQL Statement Dialog Box will appear. Click on the Build SQL Wizard button identified in the picture to the right. |
![]() Build SQL Statement Dialog Box |
Step 3: The Build SQL Wizard will appear. Select "Address1" from the Field to Set Drop Down List next to SET. |
![]() Build SQL Wizard |
Step 4: Select "Address2" as the Value from the Drop Down List next to the = equal sign.
|
![]() Values |
Step 5: Select the Conditional Item "NULL" (next to the WHERE). (NULL = zero or blank). This will ensure that in case you have updated data recently, if "Address1" already has a value, it will not be copied over with the value from "Address2".
|
![]() Conditional Operator Menu for Conditional Items |
Step 7: Click the Build Statement button. The results will appear in the Build Statement Result Box as shown on the right. Click OK. |
![]() Build Statement Result Box |
Step 8: The Build SQL Dialog Box will appear with the SQL statement filled in for you. Rename the Action Item to "Set Address1 to Address2", or whatever you wish, and click OK. Your Action Item is created.
|
![]() Build SQL Dialog Box Results |
Step 9: To execute your SQL Action Item, highlight the 50 contacts in question from the Contact List (see Select Multiple Contacts from the Contact List), then Drag and Drop the Action Item Template "Set Address1 to Address2" over to the highlighted contacts in the Contact List. Select yes in the "Apply Action Item "Set Address1 to Address2 to contact(s)" box. |
![]() Execute the SQL Action Item Example |
A confirmation box saying the items were executed successfully, similar to picture on right, should appear. |
![]() SQL Executed Confirmation Box |