Article published on the 27th of June, 2024.
This functionality is released in a Beta version. The functionality may be subject to change as bugs are found a fixed.
Contents
1. Introduction
In this article, we will demonstrate how we can set up a WorkPoint Automate process which enables us to save Teams chat messages between two individuals, on an entity in WorkPoint.
The process will be built in the Process Builder, and it will be executed from inside the Microsoft Teams interface, using a WorkPoint Teams App. If you want to read more about WorkPoint Teams Apps, please visit this article.
We will start by creating the app, and then we will create a simple WorkPoint Teams App, through which we can then use the process to save chat messages.
For the process, we will need the following steps:
- Search entity form
- Save Microsoft Teams chats form
- Save Microsoft Teams chats
For demonstration purposes, we have set up a Projects business module which contains a process on which we want to save a couple of chat messages from Microsoft Teams.
The Entity Form will allow us to select the project inside our Projects business module on which we want to save the chat messages. The Save Microsoft Teams chats form allows us to select which messages to save, and to preview them. The Save Microsoft Teams chats step then takes care of actually saving the chat messages, based on our selections.
2. Requirements
To save Microsoft Teams chats on WorkPoint entities, the business module containing entities from which you want to save chat posts/messages must use the Microsoft Teams integration in WorkPoint. You can read more about how to set up the Microsoft Teams integration in this article.
Additionally, in order to save Teams correspondence, you must give consent for WorkPoint to do so. You can do this in the "Connections" side panel in the front page of the Process Builder by clicking "Add a consent for saving Teams chat messages":
3. Process configuration
We start by creating the user process inside the Process Builder in WorkPoint 365:
The first step we add is the Search entity Form:
In the Search entity form, the user can search for and select the project the want to save the Teams chat messages on. We will leave the settings in the General tab as they are and instead configure the settings in the Options tab:
- For "Business module", we select the Projects module, and for the default view, we select a view which displays all our projects.
- Next, because we need to know where to save the Teams chats, we will not allow users to continue to the next step of the process until they have selected a project in this form.
That's all we need to set up for the Search entity form.
We now add the Save Microsoft Teams chats form to the process:
In the General tab of the Save Microsoft Teams chat form we need to add a step input. With the introduction of the Save Microsoft Teams Chat functionality in WorkPoint, a new default context object was also introduced. This context object is called "TeamsActivity". It can be used to get context information about the Teams activity of the user when WorkPoint Automate processes are run from inside Microsoft Teams. Essentially, it enables a user process to know whether it was started from an individual one-on-one teams chat, a group chat, or a Teams channel post.
This is important information for this process, because if we want to save a Microsoft Teams chat, the process we use for it needs to know the chat context in which it is run. We therefore need to use the "TeamsActivity" context object as step input for the Save Microsoft Teams chats form:
Next, we configure the options in the "Options" tab:
- For this process, we do not need to set the "Business module" field.
- For this process, we do not need to set the "Entity" field.
- For this process, we do not need to set the "Channel" field.
- In the "Start Date" field, we can specify a default start date from which we want to save Teams chats. In this instance, we leave this field blank.
- In the "End Date" field, we can specify a default end date from which we want to save Teams chats. For this case, we also leave this field blank.
- Teams chat messages may consist of text content and attachments. In the "Include messages" field, we can select a default value for whether we want to save the text contents of the message(s) we select to save. In this instance, we select "Yes", but we can change this setting on the form itself when the process is run.
- Similarly to text message contents, using the "Include attachments" field, we can select whether to save Teams chat attachments from the selected messages. In this instance, we select "Yes" as well, but just like with text contents, we can change this setting on the form itself when the process is run.
- The "Allow message preview" setting determines whether the user of the form can preview which messages are included in the scope they select in the form. If set to "Yes", a button will appear in the bottom of the form, which can be used to load the messages from the selected scope (e.g., if we select to save all messages, or messages within a date range). These can then be previewed, and if one or more chat messages should be excluded from the export, that can be done from here as well.
Next we add the "Save Microsoft Teams chat" step to the process:
On the "Save Microsoft Teams chat" step, we need to provide a step input, so that the action knows which chat messages to save. For this purpose, we can use the output from the previous form, the "Save Microsoft Teams chats form":
Next, we'll take a look at the options in the "Options" tab:
- In the "ZIP results" field, we can select whether the file(s) output in by the Save Microsoft Teams chats step should be put in a ZIP file. The default value for this field is "No", so if we do not select a value here, the resulting file(s) will simply be placed in the location we specify in the "Save location" tab, as an HTML file.
- Using the "New configuration" button, we can add additional configurations for saving other types of Teams communications, e.g., Teams Channel posts. We will not use these configurations for this process, so we will not add any of these.
Next, we move on to the "Save location" tab:
- In the "Business module" field, we can specify a business module containing the entity on which we want to save the Teams chats. In this instance, we select the Projects module.
- In the "Entity" field, we can specify the ID of the entity on the selected business module on which we want to save the Teams chats. In this case, we select the ID of the project the user selects in the Search entity form.
- In the "List" field, we select the list or library where we want to save the Teams chats. In this instance, we select the Documents library, but alternatively we could have added a "Select library or folder" step to allow the user to select a library and folder, and use the library selection here.
- Optionally, in the "Folder" field we can specify the name of a folder in which we want to save the Teams chats.
- In the "Output exists behaviour" field, we can select what should happen if we try to save one or more files where some with the same names already exists. The following options are available:
- Cancel: The save operation is canceled and no files are saved.
- Overwrite: The existing files are overwritten.
- Rename: The existing files are kept, and the new files will share the same name, but with a number as a suffix (e.g., "Chat messages (2).html").
Finally, let's take a look at the "Field" tab:
- In the "Name" and "Title" fields, we have provided the text " ChatExport". This ensures that the file being output by the Save Microsoft Teams chats step will be named and titled "ChatExport". If nothing is provided in these fields, the file is automatically named "Chat messages.html" by the system.
Let's now save and publish the process, so we can implement it into a WorkPoint Teams App.
4. WorkPoint Teams App configuration
If you want to read more about WorkPoint Teams Apps, please visit this article.
In this section, we will create a simple WorkPoint Teams App which enables the user to run the Save chat messages process.
We begin in the WorkPoint App Builder inside Microsoft Teams:
- In the WorkPoint App Builder, we create a new app.
- In the "WorkPoint Solution" section, we input out solution URL in the field, and click the "Validate" button.
When validated, the solution is locked in, and the button switches to a label, saying the URL is validated:
We then move on to the "App details" section in the left side menu:
- In the App names and Description sections, we input some metadata for our WorkPoint Teams App.
We can then move on to the "Messaging extensions" section in the left side menu:
- In the "Add a command" section, we click the "Add" button.
- In the "New command" window, we select "WorkPoint Automate". This option allows us to select a WorkPoint Automate process which we can then execute from within Microsoft Teams.
- In the Name and Description fields we provide a name and description for the messaging extension. This is the information that the user will see when they select to run the process, as shown in this image:
- Next, we can select which WorkPoint Automate process to run when this message extension is executed. In this instance, we select the process we created in the previous section of this article.
- Next, we can select from where this message extension can be executed from. Since the process we have created revolves around saving chat messages, we select to make the message extension available from the options menu on messages. For reference, the command box refers to the search box in the top middle of Microsoft Teams, and the compose box refers to the input box where users write messages, e.g., when chatting with other users.
- Finally, we save the message extension.
There are potentially much more we could add to this app, but for now, lets move on to the Package and distribute section:
- In this section, we can download the app we have configured here in the WorkPoint App Builder. The app is downloaded as a ZIP file, containing a manifest file, as well as some graphical elements. It will be named according to the name set in the "App details" section.
That's all we need to to in the WorkPoint App Builder, but we now need to upload the app we just downloaded and install it in our Microsoft Teams:
- In the left side panel of Microsoft Teams, we click the "View more apps" button and select "Get more apps".
- In the side panel of the Get more apps page, we click "Manage your apps".
- In the top panel of the Manage your apps page, we click "Upload an app".
- In the pop-up dialog, we select "Upload a custom app".
- In the file browser, we select our downloaded app and click "Open".
- In the pop-up dialog, we click "Add".
Our WorkPoint Teams App is now installed in our Microsoft Teams, and we can start using the messaging command we set up to save Teams chat messages. Let's try that now.
5. Saving Microsoft Teams chats
For demonstration purposes, we have set up a small chat correspondence between two individuals:
Let's try and save some of this correspondence:
- For one of the messages, we click the "More options", go to "More actions", and select our messaging extension "Save chat messages".
This now starts our WorkPoint Automate process we created in the first section of this article:
- Here we select a project we want to save the chat correspondence on and click the "Continue" button.
- In the Preview section, we can see the message we selected when we started the process. We can use all the other options on the form to select other scopes for saving messages, for example if we wanted to save all messages in the correspondence instead of just the selected one, and we can also select whether to include text content and/or attachments.
- In this example, we have selected to include all messages and clicked the Preview button. The section now displays all the chat correspondence.
- We can then click the Continue button to proceed to the next step.
The process now saves the chat correspondence in the Documents library of the selected project:
Once the process is completed, the following screen is presented to us:
If we take a look inside the Documents library of the project, we can now see our file:
- We can click the title of the file to view the contents:
Comments
0 comments
Please sign in to leave a comment.