Navigation:  Action Items > SQL Action Item > SQL Examples Step by Step >

SQL Example 3

Previous pageReturn to chapter overviewNext page

See Also: Create New Action Item; Dynamic Action Item; Create SQL Action Item; Executing Action Items; Scheduled Action Items; Example 1; Example 2; Merge Module Action Items

(Click Topic to view more info.  Click Back button to return to here).

Let's say you had created a Field called "Nickname" to identify several contacts by a different name, other than their actual full name (such as Mom, Dad, Aunt, Grandma, etc...), so that when you schedule a "Happy Birthday" Email Action Item to go out to them on their birthdays, the Tag in the email can be set to "NickName" instead of "FirstName".

But you don't have a nickname for your business clients who you also want to receive the  "Birthday" email.  So you need to have ContactTalk set the "Nickname" Field to equal the "FirstName" Field when the "NickName" Field is blank.

 

Step 1: Follow the instructions for Creating a New Action Item and select SQL from the drop down list.

*To create a Field called "NickName", see Add Field.

Action Item Type 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

Build SQL Statement Dialog Box

Step 3: From the Build SQL Wizard, select "MyNickName" from the Field to Set from the Drop Down List next to SET.

Select Set to Field Example

Select Set to Field Example

Step 4: In the Value box, select "FirstName".

 

Select Value Example

Select Value Example

Step 5: Select "NULL" as the Conditional Item. (NULL = zero or blank).

 

Conditional Item = NULL Example

Conditional Item = NULL Example

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 SQL Wizard Results

Build SQL Wizard Results

Step 8: The Build SQL Dialog Box will appear with the SQL statement filled in for you.  Rename the Action Item to "Nickname", or whatever you wish, and click OK.  Your Action Item is created.

 

Build SQL Dialog Box Results

Build SQL Dialog Box Results

Step 9: To execute your SQL Action Item,  highlight the desired contacts and/or groups from the Contact List (see Select Multiple Contacts from the Contact List), then Drag and Drop the Action Item Template "Nickname" over to the highlighted contacts in the Contact List.

Select yes in the "Apply Action Item "Nickname to contact(s)" box.