Send an SMS message to one or more recipients by adding the Send an SMS task to a bot.

Configure the Send an SMS task by setting the properties described in the following tables. When you are done, save the task by selecting one of the following:

  • Save - Save the task

  • Save & verify data - Save the task and verify the data defined.

  • Save & notify users - Save the task and notify users.

After you save the task, you can reuse it in other bots.

Property

Description

Default (if applicable)

Task name

Name of the task. It must be unique within your app.

Table name

Table referenced by the task. Select an existing table in the list.

Click View definition to view the structure of the selected table.

See Tables: The Essentials for more information about adding tables.

Via channel

Twilio account used to send the SMS messaeg.

Select one of the following values:

  • _AppSheet_Default_SMS - Use AppSheet's Twilio account. (Supported only in the US and Canada.)

  • _Custom_Twilio_SMS - Use your own custom Twilio account. You will need to provide additional custom Twilio settings, as described in Using your personal Twilio account.

Note: To send the SMS messaeg to contacts outside of the US and Canada, you must use your own custom Twilio account.

See Configuring your SMS account for more information.

_AppSheet_Default_SMS

To

List of SMS recipients (phone numbers).

Click Add to add a phone number or an expression using the Expression Assistant. Repeat to add additional phone numbers.

See Adding phone numbers for more information.

Use default content?

Toggle to indicate whether you want to use the default email content or provide customized content.

If enabled, the task uses default content. If disabled, customize the content using the additional properties displayed, as described below.

Enabled

If you disable the Use default content? property, customize the content using the additional properties displayed, as described below.

Property

Description

Default (if applicable)

Body

Body of the SMS message.

To define the SMS body, do one of the following:

  • Enter the SMS body in this property, including text, variables, and expressions.

  • Leave this property blank and specify a Body Template (see below).

  • Leave this property and Body Template property blank to use the default content.

Note: The Body Template property (if specified) takes precedence over this property.

"UpdateMode: <<_UPDATEMODE>>, Application: <<_APPNAME>>, TableName: <<_TABLENAME>>, UserName: <<_USERNAME>>, At: <<_NOW>>"

For example:
"UpdateMode: Update, Application: MyAppName, TableName: MyEmployees, UserName: Adam Smith, At: 6/2/2016 12:06:50 AM"



Body Template

Template to use for more precise control of the email body. See Manually creating an SMS body template and the Body property description (above).

Body Template Data Source

Data source used for the body template.

Media URLs

List of URLs that reference media files to be attached to the SMS messaeg. Media URLs can be drawings, images, signatures, thumbnails, and so on. Only GIF, PNG, or JPEG media file formats are supported.

You can add up to 10 media URLs. Each media file must not exceed 5MB.

Click Add to attach drawings, images, signatures, thumbnails, or files to be attached to the SMS message. Specify text or expressions. Repeat to add additional media URLs.

Examples:

  • https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png

  • MyPhoto.jpeg

  • [MyImage]

  • IF([Age] < 30, [MyImage1], [MyImage2])

The following sections provide more information about configuring the Send an SMS task:

Configuring your SMS account

AppSheet sends SMS messages via Twilio. You can use AppSheet's Twilio account (United States and Canada only) or a custom Twilio account, as described in the following sections.

Using the AppSheet Twilio account

Note: The AppSheet Twilio account works only in the United States and Canada.

To use the AppSheet Twilio account, select _AppSheet_Default_SMS in the Via channel property when configuring the Send an SMS task (as described above).

Consider the following when using the AppSheet Twilio account:

  • All Twilio SMS-related charges are paid by AppSheet.

  • You must be enrolled in an AppSheet Starter, Core, Publisher Pro, Enterprise Standard, or Enterprise Plus subscription plan.

  • You can send SMS messages to phone numbers located in the United States and Canada.

  • You cannot send SMS messages to premium-rate phone numbers having area codes that begin with 9xx.

  • The SMS message body may contain at most 160 characters.

Using your personal Twilio account

Sign in to your personal Twilio account to access account information and upgrade your account (if required):

  1. Sign in to your personal Twilio account.
    If you do not have a Twilio account, complete the sign up process. It may ask you to verify a phone number. This is used for security purposes only.

  2. After you are signed in, under Account Summary (https://www.twilio.com/console/account/settings) locate your Twilio Account SID and your Twilio Auth Token under LIVE Credentials. (View the Twilio Auth Token using the More menu.) You will need this information when configuring SMS using AppSheet.

  3. If required, upgrade your Twilio account from a trial account by clicking https://www.twilio.com/console/billing. You can then click add funds and turn on auto renew based on your projected usage. You can also create alerts and auto recharges, as well.

  4. Choose your Twilio phone number by navigating to https://www.twilio.com/user/account/phone-numbers/search. From here, search for a phone number that you would like to use for your account to confirm its availability. Twilio recommends searching by area code when searching for a phone number. After you find a phone number that is available click buy.

To use a your personal Twilio accountm, when configuring the Send an SMS task (described above), select _Custom_Twilio_SMS in the Via channel property, and customize the Twilio settings using the additional properties displayed, as described below.

Field

Description

AccountSid

Your Twilio account ID.

Available under your personal Twilio Account Summary at: https://www.twilio.com/console/account/settings

AuthToken

Your Twilio account Auth token.

Available under your personal Twilio Account Summary at: https://www.twilio.com/console/account/settings

CountryCodes

List of ISO 3166-1 Alpha-2 two-letter country codes used to validate phone numbers.

Click Add to add an ISO 3166-1 two-letter Country Code. Repeat to add two-letter country codes for each country having a To or From phone number.

From

Phone number used as the source of the SMS. Specify text and expressions.

See Adding phone numbers for more information.

Consider the following when using your personal Twilio account:

  • All Twilio SMS-related charges appear on your personal Twilio account.

  • You must be enrolled in an AppSheet Starter, Core, Publisher Pro, Enterprise Standard, or Enterprise Plus subscription plan.

  • You can send SMS messages to phone numbers located in the countries you specify in your SMS automation rule.

  • For your protection, you cannot send SMS messages to premium-rate phone numbers for which higher rates are charged. For example, premium-rate phone numbers in the United States often begin with 9xx. This restriction does not apply to valid, non-premium-rate phone numbers such as those within area code 912 in the United States, for example.

  • The SMS message body may contain at most 1600 characters.

Adding phone numbers

The following provides guidelines for adding phone numbers in the To property when configuring the Send an SMS task:

  • Enter a specific phone number, such as 4255551212 or +14255551212.
    To enter a phone number that contains special characters such as hyphens, parentheses, or spaces, you must enclose the phone number in quotes. For example:
    "(425) 555-1212"
    "425-555-1212"
    "425 555 1212"

  • Use a field in a record that is being modified.
    For example, when a new order is received, you can send an SMS message to the customer who created the order. In this scenario, enter the name of the field that contains the customer's phone number. For example, if the CustomerPhone field in the order record contains the customer's phone number, enter the following expression: [CustomerPhone]

  • Use a field in a record that is referenced by the record being modified.
    For example, when a new order is received, you can send an SMS message to the customer who created the order. Each order record might contain a reference to a customer record that contains the customer's phone number. In this scenario, enter the name of the order record field that references the customer record followed by the name of the customer record field that contains the customer's phone number. For example, if the order record field that references the customer record is CustRef and the name of the customer record field containing the customer's phone number is CustPhone, specify the customer's phone number by entering the expression: [CustRef].[CustPhone]

  • Use an entire column in another table.
    For example, each time a new order is added, you can send an SMS message to all of the people defined in another table. In this scenario, enter the name of the table followed by the field that contains the phone number. For example, if you create a table called PeopleToInform that contains two columns, Name and Phone, each time a new order is added, you can send SMS messages to all of the people in the PeopleToInform table by entering the expression: PeopleToInform[Phone]

Manually creating an SMS body template

Note: To support the use of SMS body templates, Google must be a supported data source.

Manually create an SMS template file by creating an empty text file, entering valid content, and saving the file using a .txt extension. For information about customizing the template, see Customizing content using templates.

The following provides an example of an SMS body:

Congratulations <<[FirstName]>> <<[LastName]>>.
Your order for <<[Qty]*[Price]> shipped <<TODAY()>>.
<<If: [Expedited] = true>>
You order will arrive in one business day.
<<EndIf>>
<<If: [Expedited] = false>>
You order will arrive in three to five business days.
<<EndIf>>

The resulting SMS message contains the content with all variables and expressions evaluated and replaced with the appropriate values.

Note: You must ensure that the resulting SMS message length does not exceed the maximum SMS message length of 160 characters when using the AppSheet Twilio account or 1600 characters when using your personal Twilio account.

After the template file is saved to your computer, upload it to Google Drive as follows.

  1. Ensure that the Convert uploaded files to Google Docs editor format option is disabled as described in Uploading .txt templates to Google Drive.

  2. Open Google Drive and navigate to the Google Drive folder where you wish to upload the file.

  3. Click New and then click File upload.

  4. When the file open dialog appears, navigate to the template file on your computer, select the file, and click Open.

After the template file is uploaded, use it as described in Using an existing template.

Each time you modify the SMS template you must upload the template file to Google Drive. Google Drive will retain the original DocId. AppSheet will use the last uploaded version of the template file as the attachment template.

Viewing the template

After uploading the template, click View adjacent to the template property to view the template.

Editing the template

To edit the template:

  1. Download the template file from your data source to your computer.

  2. Edit the template file on your computer using the text editor of your choice.

  3. Upload the edited template file from your computer to your data source.

Did this answer your question?