Skip to content

Commit d0e68f3

Browse files
authored
Merge pull request #6 from pnp/alexc-msft/sharing-bugfix
Fixing prompt adaptive cards and engage messages
2 parents 05a655a + 92215a5 commit d0e68f3

File tree

4 files changed

+56
-8
lines changed

4 files changed

+56
-8
lines changed

Documentation/Architecture.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,27 @@ The following connectors are used in the Prompt Pulse solution:
1010
- Office 365 Users
1111
- SharePoint
1212
- Microsoft Teams
13+
- Office 365 Groups
1314

1415
When executed from the Power App (to retrieve Groups, Teams and Viva Engage communities) they will be executed in the context of the current user so they should only see ones they have access to. They will also only see group chats they are part of.
1516

17+
It's worth noting that Group Chats and Viva Engage Communities are pulled into the app via two flows.
18+
1619
The above connectors are also used in the Power Automate flows.
1720

21+
## Service Account
22+
23+
**It is highly recommended to deploy Prompt Pulse using a dedicated service account/M365 user** and share the app across the organization/with the required users. The UPN for this service account is stored in the configuration list.
24+
25+
Adaptive cards and Viva Engage notifications are sent using the account that deploys the Prompt Pulse Power Platform solution and configures the connections. Therefore by using a service account you can control the name of the user the notifications come from.
26+
27+
In addition, in order to post the cards/notifications, the user account sending them needs to be member of the Team, Group Chat, Viva Engage community, this is handled automatically (with the exception of Group Chats) through the app. **Bear this in mind because not using a service account would result in the user who deployed the solution being added to these locations**.
28+
1829
## Power App
1930

2031
The Prompt Pulse Power App is a canvas app using mostly **modern** controls where possible. Prompts that are shared/scheduled are stored in the **Prompts** SharePoint list.
2132

22-
The app uses the above connectors to interact with the SharePoint site/lists and retrieve the locations in which to share the prompts.
33+
The app uses the above connectors (and flows listed below) to interact with the SharePoint site/lists and retrieve the locations in which to share the prompts.
2334

2435
The app can be customized if you wish, though it's worth noting that customizations will be lost if you attempt to update the solution in the future when new releases are available.
2536

@@ -63,6 +74,30 @@ The flow then increments the value of the 'Likes' column by 1 and adds the promp
6374

6475
If this value does not exist, it is appended to an array and the value of the 'LikedPrompts' column in the Users list is updated.
6576

77+
## Get Group Chats
78+
79+
This flow is triggered in the Power App when it is opened. It uses the Microsoft Teams connector to perform the following high-level steps:
80+
81+
- Get group chats the user is part of.
82+
- Loop through group chats.
83+
- List members.
84+
- Check to see if the Prompt Pulse service account is a member of the chat AND that the chat has a name.
85+
- Return only the chats that contain the service account.
86+
87+
This flow is required because prompt adaptive cards will not send if the service account is not a member of the chat. At the time of writing there is no workaround for this other than for the user to add the service account to the chat manually.
88+
89+
## Get Engage Communities
90+
91+
This flow is triggered in the Power App when it is opened. It uses the Viva Engage and Office 365 Groups connectors to perform the following high-level steps:
92+
93+
- Get communities the user is a member of.
94+
- Loop through communities.
95+
- Get the M365 group for the community by filtering on the display name (may retrieve multiple groups).
96+
- Loop through the returned groups checking for ones where 'creationOptions' contains 'YammerProvisioning' (Viva Engage backed group).
97+
- Return the communities along with the groupids.
98+
99+
This flow is required because the native Viva Engage connector does not return the M365 group id for the community. The group id is needed to add the service account to the group through the app when sending a prompt.
100+
66101
## Data Source
67102

68103
As detailed in the [Overview](Overview.md) documentation, there are 3 SharePoint lists used in prompt pulse. Please see the details of each list below and what each column is used for:

Documentation/Deployment-guide.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ To begin, you will need:
88

99
- Power Apps and Power Automate (seeded licenses) enabled and rolled out across your organisation.
1010
- Power Apps environment with a Dataverse database deployed (only required due to the solution using Environment Variables). You may use the default environment, however a production environment is recommended. If you do not have capacity to create a Dataverse database, you may need to use the default environment.
11-
- Service account (optional) to deploy the Power App and Flows, if you do not wish to create a service account then an ordinary user with Environment Maker permissions is adequate.
12-
- Access to the Power Apps environment you wish to deploy to (Environment Maker) access.
11+
- Service account (**highly recommended**) to deploy the Power App and Flows. This should be a normal M365 user with a license that includes Power Apps, SharePoint, Viva Engage, Power Automate and Outlook. The account can have MFA enabled and you may choose the display name to suit your organization.
12+
- Access for the service account to the Power Apps environment you wish to deploy to (Environment Maker) access.
1313
- SharePoint site which will contain the lists - we recommend creating a new one for Prompt Pulse.
1414
- Full Control access to the above site.
1515
- Regional settings set correctly on the SharePoint site for your timezone and locale (this is important for the scheduling to work correctly).
@@ -58,9 +58,15 @@ Title: AppId
5858

5959
Value: Leave empty
6060

61+
9. Create a second list item in the above list with the following details:
62+
63+
Title: ServiceAccountUPN
64+
65+
Value: UPN (Email) of your service account
66+
6167
## Step 2: Deploy Power Apps solution
6268

63-
1. Navigate to **Power Apps**.
69+
1. Navigate to **Power Apps** as the service account.
6470
2. Click on the **Solutions** tab.
6571
3. Click on **Import**.
6672
4. Upload the solution zip file and click **Next**.
@@ -77,7 +83,7 @@ Value: Leave empty
7783
2. Share the app with all users who will use Prompt Pulse (you may want to add any administrators as co-owners so they can modify the app if you wish to).
7884
3. Test the app by 'Playing' it.
7985

80-
You may also wish to share the 3 flows (**'Send Scheduled Prompt'**, **'Send Prompt'** and **'Like Prompt'**) with admins who may need to view the run history or edit them. You can find them under **Flows** in the **Power Apps** portal or in the **Power Automate** portal.
86+
You may also wish to share the 5 flows (**'Send Scheduled Prompt'**, **'Send Prompt'**, **'Like Prompt'**, **'Get Group Chats'** and **'Get Engage Communities'**) with admins who may need to view the run history or edit them. You can find them under **Flows** in the **Power Apps** portal or in the **Power Automate** portal.
8187

8288
## Step 3: Add the app to Teams (Optional)
8389

Documentation/Overview.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Prompt Pulse consists of the following components:
44

55
- Power App
6-
- 3 x Power Automate flows.
6+
- 5 x Power Automate flows.
77
- 3 x SharePoint lists for data storage
88

99
For more details on what each of these does please check out the [Architecture](Architecture.md) documentation.
@@ -39,6 +39,8 @@ From the main screen, the process for sharing a prompt is as follows:
3939

4040
- Once sent, users will receive a notification in the format of an adaptive card in the chosen location.
4141

42+
**Note - Only group chats with a name AND the Prompt Pulse service account/user added as a participant will display in the app. Users will need to add this user manually for the group chat to be visible in the app.**
43+
4244
<img src="https://github.com/pnp/prompt-pulse/blob/main/Documentation/Images/prompt-pulse-share-screenshot.png?raw=true" alt="Prompt Pulse Share Screenshot"><br/>
4345

4446
### Viewing/using prompts
@@ -75,6 +77,7 @@ The **Send Now** option sends the prompt straight away and removes it from the s
7577

7678
### Tips
7779

80+
- Use a dedicated service account/M365 user when deploying Prompt Pulse (adaptive cards will be sent from this account).
7881
- Deploy the app in the Teams admin center to allow users to install.
7982
- Add the app in Teams as a tab where appropriate.
8083
- Encourage users to install and pin the app in the rail.
@@ -84,17 +87,21 @@ The **Send Now** option sends the prompt straight away and removes it from the s
8487

8588
- In it's current iteration, Prompt Pulse shows ALL prompts that have been shared irrespective of where the app is installed (personal app or in a teams tab) so bear this in mind when sharing prompts.
8689
- Sharing prompts in a personal install of Prompt Pulse will also show these prompts in Prompt Pulse when installed as a teams tab.
90+
- Only group chats that include the Prompt Pulse service account/user will appear in the app. Users will need to add this account into the group chat manually in order for it to display.
91+
- The Prompt Pulse service account/user will be automatically added to Teams and Engage Communities when a prompt to the location for the first time.
8792

8893
Bear the above in mind when using Prompt Pulse, in a future iteration we will look to add support for sharing and viewing prompts in only the team the app is installed in.
8994

9095

9196
## Power Automate Flows
9297

93-
There are 3 flows that are part of the Prompt Pulse solution, these are listed below along with a brief description of what these do, for more details please view the [Architecture](Architecture.md) documentation.
98+
There are 5 flows that are part of the Prompt Pulse solution, these are listed below along with a brief description of what these do, for more details please view the [Architecture](Architecture.md) documentation.
9499

95100
- Send Prompt: This flow executes when a list item is created or modified in the 'Prompts' list and sends the prompt to the specified location using adaptive cards or in the case of Viva Engage, a message.
96101
- Send Scheduled Prompt: This flow runs on a recurrent schedule (5 minutes by default) and is responsible for checking for scheduled prompts in the list and sending these.
97102
- Like Prompt: This flow runs when a user clicks the **Like Prompt** button in the adaptive cards and adds the prompt to the users' liked prompts.
103+
- Get Group Chats: This flow is used in the Power App and retrieves a list of group chats that the current user is a member of where the Prompt Pulse account is a member of the chat.
104+
- Get Engage Communities: This flow is used in the Power App and returns a list of Viva Engage Communities that the current user is a member of.
98105

99106
## Data Storage
100107

@@ -104,7 +111,7 @@ There are 3 SharePoint lists used in the solution:
104111

105112
- Prompts: Stores the prompts shared/scheduled in the app.
106113
- Users: Stores the users who have opened/used Prompt Pulse and their liked prompts.
107-
- Configuration: Stores configuration settings for Prompt Pulse, at the time of writing it is only used to store the ID of the Power App (required for deep linking the adaptive cards in Teams).
114+
- Configuration: Stores configuration settings for Prompt Pulse.
108115

109116
These lists can be easily extended or changed should you wish to modify/customize Prompt Pulse. You can of course edit and delete prompts directly from the list if required. Avoid modifying the values of the GroupId, GroupChatId, TeamId, ChannelId and MessageId columns as these are used heavily in the Power Automate flows.
110117

1.84 MB
Binary file not shown.

0 commit comments

Comments
 (0)