How to add files to comments in SAC

SAP Analytics Cloud (SAC) offers a commenting function that allows users to easily post their opinion on values or explain a status. They can e.g. right-click on a value and choose "Add Data Point Comment" ...

/mimes/SAC_Screenshots/biSharing_A.PNG

...enter a comment and choose "Place Comment":

/mimes/SAC_Screenshots/biSharing_B.PNG

These comments are then visible for others, who can also “like” the explanations.

/mimes/SAC_Screenshots/biSharing_C.PNG

How to post files in SAC comments?

Unfortunately SAP Analytics Cloud only supports pure text comments. So what if you want to share files with your colleagues that shall prove your point or provide further explainations?

biexcellence’s biSharing Custom Widget allows you to upload files and post the link into your comments. It supports both classic on-premise Sharepoint installations as well as Office365 OneDrive configurations.

Let's have a look at a simple demo application:

/mimes/SAC_Screenshots/biSharing_02.PNG

This simple demo application contains:

  • Table Component to display the data
  • Text Area Component to enter a comment, which will be posted with the document link that is provided by the biSharing Widget
  • Button to request the document link from the biSharing Widget
  • biSharing Widget, which is not visible to the end user but provides the script methods to make it happen

The workflow for posting a comment with link in theis demo application is that the user:

  1. selects the cell of the Table Component, which shall be commented
  2. enters the comment in the Text Area, e.g. “This is my comment
  3. clicks on the Button “Post & add link”.
  4. Having selected the file to share (see below how this is done in detail) the user finally sees the comment and link posted to the cell:

/mimes/SAC_Screenshots/biSharing_03.PNG

Using the biSharing Widget

Only two events are needed to realize this scenario:

  1. onClick of ButtonPost & add link”:
    /mimes/SAC_Screenshots/biSharing_04.PNG
  2. onSuccess of biSharing Widget:
    /mimes/SAC_Screenshots/biSharing_05.PNG

The following main methods are provided to produce the document link (they will described in detail further below):

  • uploadToShare
  • selectToShare

The following events are provided:

  • onSend: Triggered when uploadToShare or selectToShare is called. You can use it e.g. to call Application.showBusyIndicator()
  • onSuccess: Triggered when the service link is ready. As in the example above, you can access the link by calling getServiceMessage(). Of course you can also hide the busy indicator here.
  • onError: This event is triggered if the document link could not be determined. A call of getServiceMessage() will provide you with the reason or error message.

The following properties are provided:

/mimes/SAC_Screenshots/biSharing_01.PNG

  • Sharing – Channel: Defines the tool which shall be used for sharing and providing the document link, respectively. Currently only Microsoft Sharepoint and OneDrive are available. The solution can easily be enhanced to support SAP systems, Web Services, etc.
  • Server Url: Specifies biexcellence’s cloud service, which hosts the sharing services
  • License Key: For evaluation purposes, please enter your user that you registered on www.biexcellence.com

Upload a file to Sharepoint and share its link in a comment

The central method for this scenario is uploadToShare. When it is called, the biSharing Widget shows a file selector within the dashboard, uploads the file to Sharepoint and returns the link for the uploaded file.

  1. The display of an upload popup is triggered via uploadToShare:/mimes/SAC_Screenshots/biSharing_06.PNG
  2. The user can click on “+” to select a file from the computer. The file is instantly uploaded to SharePoint.
  3. Once the process is finished, the onSuccess event is triggered.

To make this work, access to the Sharepoint instance has to be configured. This is done with the addConnectionParameter method:

biSharing_1.addConnectionParameter("site", "mysharepointurl"); biSharing_1.addConnectionParameter("library", "mylibrary"); biSharing_1.addConnectionParameter("user", "myuser"); biSharing_1.addConnectionParameter("pwd", "mypwd");

In the next version, these parameters can also be centrally defined for your organization on our Cloud Service.

Select a file from Onedrive and share its link in a comment

The central method for this scenario is selectToShare. When it is called, the Widget opens the onedrive login, afterwards shows the folder structure of OneDrive  and allows to select a file to share via a comment.

  1. A popup window is triggered via selectToShare, where the user is asked to enter the credentials:/mimes/SAC_Screenshots/biSharing_07.PNG
  2. The user is forwarded to the file selector./mimes/SAC_Screenshots/biSharing_08.PNG
  3. An existing file can be selected. Alternatively, a new one can be uploaded and s elected.
  4. Open” must be clicked to return the link of the selected file and to trigger the onSuccess event.

To make this scenario work, you have to provide the clientId of your onedrive account:

biSharing_1.addConnectionParameter("clientId", "myclientid");

The following link decribes how to set up the clientid for your Office365 account:https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/?view=odsp-graph-online#setting-up

Thilo Knötzele
Author: Thilo Knötzele
Creation date: 27.05.2020
Category: Commenting
back to overview