Welcome to the Module on Notifications, Messaging, and Report Generation. In this module, we discuss how we can use automation bots in AppSheet to send push notifications, text messages, and embedded app via email. We also discuss how to generate files and reports from your app. In this first lesson, you'll learn how to send push notifications and text messages from your AppSheet app. Let's get started. What is a push notification? A push notification is a mechanism to alert app users with a message that is directly delivered to the home screen of their mobile device. An application provider or server initiates the notification, and the user doesn't need to open any specific app on the device to receive the message. The user must agree to receive push notifications from a given app. To send push notifications, the app provider registers with the push notification service for the mobile device operating system, Android or iOS. The push notification service routes a notification from the application provider to the app user's device. As the app creator, you can use AppSheet to easily create and send push notifications. Once created, push notifications can be triggered by app activity from any user. Let's walk through this process with a sample employee onboarding app. As discussed in the previous module, we create a bot event process and step in the automation section of the AppSheet editor. We will repeat this process to set up push notifications that are sent by the app. First, we will begin by creating a task. To create a task, navigate to the automation Task tab in the AppSheet editor. Click "New Task". To configure the Task select the "Task Category", send a notification. Enter a task name send hire date change notification. Our sample bot will send this notification whenever the hire date of an employee is modified in the app. For table name, select the table whose data is used by the task. In this case, it's the employee table. To add the recipients of the push notification click "Add", and enter their email addresses. To customize the content of the notification message, disable the option use default content. Provide the title, body, and an optional deep link for the content of the notification message. Click "Save". The notification message body uses template variables to substitute data values from the employee table. In particular, the this row before and this row after variables are used for the hire date column to include its value before and after an employee row is updated in the app. We will discuss template variables in a lesson later in this module. Next, create a process with a step that uses our newly created task. To create the process navigate to the automation processes tab in the AppSheet editor. Click "New Process" and provide a name for the process. For this use case we named the process, notify hire date change. Select the table that this process applies to employee. Add a step to the process and provide a name for the step. For the step type, select "Run a Task", then select the tasks that was created earlier. Click "Save". Next we create an event that will trigger a bot that executes this process. To create an event navigate to the automation events tab in the AppSheet editor. Click "New Event" and provide a name for the event. Set the event type to data change, then select "Updates Only". This event will only triggered a bot when a row in the table is updated in the app. For the table whose data updates trigger the event select "Employee". Click into the condition field to launch the expression assistant. Because we want the notification to be sent only when the value in the hire date column is updated in the expression assistant, type the condition shown. This row before.[Hire date] does not equal this row after.Hire date. If the value in the hire date column is different after the update, the expression returns true. When the value is updated, the event is triggered. Click Save. Finally, we create a bot that will be triggered by this event. To create a bot, navigate to the automation bots tab in the worksheet editor. Click New bot and provide a name for the bot. To configure the event that triggers the bot, click Configure event. From the list of events, select the event that was created earlier. From the list of processes, select the process that was created earlier. Click Save. We now have all the components in place for our automation bot. Let's test it in the app preview. First, edit one of the employee records by updating the employers hire date. Then click Save to update the data to the back end. After the record is updated, a notification is received on the users registered mobile device. The notification is sent to the user whose email address was specified in the task configuration. Each time the employee is hired data's updated with a different date, notification is received by the user. Let's review the requirements for receiving push notifications. For a user to receive AppSheet push notifications, the app must surpass the deployment check and be deployed. This requirement ensures that you do not inadvertently send email messages, SMS messages, or notifications when you debug your bot. The user must have signed into at least one AppSheet app that requires user authentication by using the email address that is specified in the "To" property of the task configuration. This app can be different from the app that sends the push notification. Note that to sign into an app from a device, the iOS or Android AppSheet hosting app must first be installed on the device. The specified user email address must be translated to an AppSheet user ID by AppSheet. The user ID must then be translated into a list of one or more Firebase Cloud Messaging device tokens by AppSheet. A unique device token is registered for each device that the user has used to sign into an AppSheet app. If the user has more than one device and has signed into an AppSheet app from those devices, a notification is sent to each one of them. If AppSheet cannot find an AppSheet user ID for the user email address specified in the "To" property of the task configuration, or cannot find at least one device token for the AppSheet user ID, an entry is added in the apps audit history that reports a warning. Let's review how you can set the two property of the notification task. The value of the two property in the notification task configuration specifies the email addresses of the recipients of the push notification. You can specify the value of this property in the following ways: use a specific email address, email addresses that contains special characters such as hyphen or plus must be enclosed in quotes. Multiple email addresses must be entered on a separate line. Use the email address value from a column of the row that is being added or updated. For example, customer email, the column name must be enclosed in square brackets. Use a column value of the row that is referenced by the row being added or updated. Use the values in a column from all the rows of a table by using the expression table name, email address column. This expression can be used to provide multiple email addresses as a value of the two property. Let's review how we can set the title and body of the notification message. To set the title or the notification message, you can use the default title generated by AppSheet, or override the default title by configuring the task with their own title text. The title can optionally include variables whose values are substituted by AppSheet when the notification is sent. In our sample Onboarding App, we can include the employee ID in the title, or in the body of the notification message about the change in the hire date. The employee ID is stored in the ID column of the employee table. To set the body of the notification message, you can use the default body generated by AppSheet or override the default body content to use your own customized texts with optional variables. In our sample employee Onboarding App, we customized the employee hire date change notification message body as shown. You can also specify a deep link to include in the notification message. The deep link can link to your AppSheet app which is a default of filtered view within your app, a specific row in a view within your app, or a form within your app with pre-filled values. You can also use a custom deep link generated from an expression. This is a deep link to our sample employee Onboarding App.