|
| 1 | +--- |
| 2 | +title: Add "Notify me" settings to category in Bulletins app |
| 3 | +description: Learn about how to customize the Bulletins app to add "Notify me" settings to category |
| 4 | +author: sbahl10 |
| 5 | +ms.service: powerapps |
| 6 | +ms.topic: conceptual |
| 7 | +ms.custom: |
| 8 | +ms.date: 07/09/2021 |
| 9 | +ms.author: v-shrutibahl |
| 10 | +ms.reviewer: tapanm |
| 11 | +contributors: |
| 12 | + - joel-lindstrom |
| 13 | + - navjotm |
| 14 | + - tapanm-msft |
| 15 | + - sbahl10 |
| 16 | +--- |
| 17 | + |
| 18 | +# Add "Notify me" settings to category |
| 19 | + |
| 20 | +The Bulletins Power App Template for Teams provides a central ___location for all company communication such as broadcasts, memos, announcements, and company news. The app allows you to create, categorize, bookmark, search, and read bulletin posts. |
| 21 | + |
| 22 | +The Bulletins app solution consists of two apps: |
| 23 | + |
| 24 | +[Manage bulletins app](bulletins.md#manage-bulletins-app) |
| 25 | + |
| 26 | +- Manager experience for managing **Bulletins** app. |
| 27 | + |
| 28 | +- Allows managers to create, edit, and categorize posts read through the Bulletins app. |
| 29 | + |
| 30 | +[Bulletins app](bulletins.md#bulletins-app) |
| 31 | + |
| 32 | +- Central ___location for all company communication such as memos, broadcasts, and news. |
| 33 | + |
| 34 | +- Shows bulletins, FAQs, links, and contacts created using the **Manage bulletins** app. |
| 35 | + |
| 36 | +In this article, we'll learn how to add functionality where the user can select for which categories they should get notified when bulletins get added, and send an email notification using Power Automate flow, when a new bulletin is created. |
| 37 | + |
| 38 | +When users are busy, excessive notifications can be a distraction. Users want to know when relevant announcements and news are posted, but they don’t want to be distracted by the noise of information about areas that don’t apply to them. By allowing users to opt in to notifications, they can subscribe to the areas that are relevant for them, and be notified about what matter most to them. |
| 39 | + |
| 40 | +> [!NOTE] |
| 41 | +> Before you proceed, review [customize Bulletins app](customize-bulletins.md). |
| 42 | +
|
| 43 | +## Prerequisites |
| 44 | + |
| 45 | +To complete this lesson, we'd need the ability to log in into Teams that will be available as part of select Microsoft 365 subscriptions, and will also need to have the Bulletins Power Apps template for Teams installed. This app can be installed from <https://aka.ms/TeamsBulletins>. |
| 46 | + |
| 47 | +## Create a new table called Bulletin Notifications |
| 48 | + |
| 49 | +To get started, let’s add a table to store the notification settings. |
| 50 | + |
| 51 | +1. Select **Power Apps** from the left-pane in Teams. |
| 52 | + |
| 53 | +1. Go to **Build** > **Built by this team**. |
| 54 | + |
| 55 | +1. Select **See all** under list of all items created to open the list of all the objects used in all the apps created in the selected team. |
| 56 | + |
| 57 | +1. Select the **+ New** > **Table**. |
| 58 | + |
| 59 | +1. Enter the table name as "Bulletin Notifications". |
| 60 | + |
| 61 | +1. Open the table, and open the **Name** field of the table. |
| 62 | + |
| 63 | +1. Change data type to autonumber. |
| 64 | + |
| 65 | +1. Set the minimum number of digits to 4, and the seed value as 1000. |
| 66 | + |
| 67 | +1. Using **Add column** on the top, add the following columns. |
| 68 | + |
| 69 | + | Column name | Data type | Related table | |
| 70 | + | - | - | |
| 71 | + | User ID | Lookup | User | |
| 72 | + | Category | Lookup | Bulletin Category | |
| 73 | + |
| 74 | +## Add a toggle control to turn the notifications on and off |
| 75 | + |
| 76 | +1. In the Bulletins app. |
| 77 | + |
| 78 | +1. From the **Tree view**, select the **Home** screen. |
| 79 | + |
| 80 | +1. Select **galBulletins_ByCategory** from the tree view. |
| 81 | + |
| 82 | +1. Select **Insert** > **Input** > **Toggle**. |
| 83 | + |
| 84 | +1. Set the following properties on the added toggle control. |
| 85 | + |
| 86 | + | Property | Value | |
| 87 | + | - | - | |
| 88 | + | X | `Parent.Width - Self.Width` | |
| 89 | + | Y | `lblGalBulletins_ByCategory_Name.Y` | |
| 90 | + | On Text | Turn off notifications | |
| 91 | + | Off Text | Turn on notifications | |
| 92 | + | Width | 200 | |
| 93 | + | Height | `lblGalBulletins_ByCategory_Name.Height` | |
| 94 | + | OnCheck | `Patch('Bulletin Notifications',{Category: LookUp('Bulletin Categories', 'Bulletin Category' = ThisItem.appCategoryGUID),'UserID':gblUserRecord})` | |
| 95 | + | OnUnCheck | `Remove('Bulletin Notifications',LookUp('Bulletin Notifications',Category.'Bulletin Category'=ThisItem.appCategoryGUID&&'User ID'.User=gblUserRecord.User))` | |
| 96 | + | Checked | `!IsBlank(LookUp('Bulletin Notifications', Category.'Bulletin Category' = ThisItem.appCategoryGUID && 'User ID'.User = gblUserRecord.User))` | |
| 97 | + |
| 98 | +## Publish the Bulletins App |
| 99 | + |
| 100 | +All the changes to the Bulletins app are completed. The app can now be published by selecting **Publish to Teams** on the top-right. |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | +## Create Power Automate flow to send email notification |
| 105 | + |
| 106 | +1. Open Power Apps in Teams. |
| 107 | + |
| 108 | +1. Go to **Build** > **Built by this team**. |
| 109 | + |
| 110 | +1. Select **See all**. |
| 111 | + |
| 112 | +1. Select **+ New** > **Cloud flow** > **Automated**. |
| 113 | + |
| 114 | +1. Enter the flow name as "Send notification based on the notification flag when a new bulletin is created". |
| 115 | + |
| 116 | +1. Select the trigger as **When a new row is added, modified, or deleted**. |
| 117 | + |
| 118 | +1. Create the flow with the steps explained in the following screens. |
| 119 | + |
| 120 | +  |
| 121 | + |
| 122 | +  |
| 123 | + |
| 124 | +  |
| 125 | + |
| 126 | +1. Save the flow. |
| 127 | + |
| 128 | +## Test the app |
| 129 | + |
| 130 | +1. Log in into Teams, and go to the team where the Bulletins app is installed. |
| 131 | + |
| 132 | +1. Select the **Bulletins** app. |
| 133 | + |
| 134 | +1. Select the Turn on notifications toggle to turn on notifications for the particular categories. |
| 135 | + |
| 136 | +  |
| 137 | + |
| 138 | +1. Now, select the **Manage Bulletins** tab on the top. |
| 139 | + |
| 140 | +1. Select **New Bulletin** on the top-right. |
| 141 | + |
| 142 | +1. Select the category for which you want the bulletin created, such as "Customer Updates". |
| 143 | + |
| 144 | +1. Enter a title, such as "Upcoming Offers". |
| 145 | + |
| 146 | +1. Enter a subtitle, such as "Summer offers for customers". |
| 147 | + |
| 148 | +1. Enter a description, such as "This Bulletin will list all the upcoming summer offers for customers". |
| 149 | + |
| 150 | +1. Select **Save**, and **Publish**. |
| 151 | + |
| 152 | +1. In a few minutes, an email as shown in the image below should appear in the inbox of the email address that was provided in the Power Automate flow. |
| 153 | + |
| 154 | +  |
| 155 | + |
| 156 | +### See also |
| 157 | + |
| 158 | +- [Understand Bulletins sample app architecture](bulletins-architecture.md) |
| 159 | +- [Customize Bulletins app](customize-bulletins.md) |
| 160 | +- [Sample apps FAQs](sample-apps-faqs.md) |
| 161 | +- [Use sample apps from the Microsoft Teams store](use-sample-apps-from-teams-store.md) |
| 162 | + |
| 163 | +[!INCLUDE[footer-include](../includes/footer-banner.md)] |
0 commit comments