2

SAP Companion Conditions: Hidden Treasure for SAP SuccessFactors and more

 1 year ago
source link: https://blogs.sap.com/2022/10/28/sap-companion-conditions-hidden-treasure-for-sap-successfactors-and-more/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
October 28, 2022 4 minute read

SAP Companion Conditions: Hidden Treasure for SAP SuccessFactors and more

What if we could show different content for the same screens/modules/fields for different groups of users? i.e. those who are assigned to the manager position should see different content in SAP Companion, than employees. Or different content should be provided for users employed in different countries. With the vanilla settings, SAP Companion uses the system UI only as a differentiator, that might be not enough.

Without further ado, I want to demonstrate one interesting feature that SAP Companion has, but this feature hasn’t been widely advertised (yet) and is kept as a secret spice 😉 The feature’s name is Conditions.

My Scenario

It’s pretty simple:

  1. When the user logs in to SAP SuccessFactors I want to check whether this user occupies a Manager position or an employee.
  2. Once I acquire this information, I want to tell SAP Companion to show content that is relevant to this user profile and also content that is intended to be visible to everybody.
  3. I want to hide the content that is not developed for my user.

What is required:

  1. SAP Web Assistant Extension that could be downloaded from Google Chrome or MS Edge Stores.
  2. SAP Companion Configuration script, which you can get here
  3. Windows Registry file to roll out pre-configured extension enterprise-wide. An example please find here

Configuration Steps

After installing the SAP Web Assistant extension open your SAP Enable Now Manager using the account with assigned roles: In-App Help Administrators, Snippet Authors.

Let’s create new Snippet+Configuration that are required for the SAP Web Assistant Extension. Administration – SAP Companion Integration. Then select the Snippets tab and press +Add

Assign a Name to your snippet i.e. SFSF Conditions, and choose the type Configuration Template. Finally, paste the SAp Companion Configuration script source code you downloaded previously (requirement #2 above). Save your new snippet.

Move to the Configurations tab and create a new Configuration that uses our snippet. Should look like this.

SFSF_Conditions_1.png

Copy to the clipboard the URL of your configuration, that you need to add to the SAP Web Assistant extension. Simply click on the link icon next to your configuration.

SFSF_Conditions_2-1.png

Almost done. Make sure, that the CORS is activated in your SAP Enable Now Manager (Administration – Server Settings – CORS Enabled) and that your SAP SuccessFactors system URL is whitelisted in the CORS Allowed Sites field.

SFSF_Conditions_3-1.png

Finally, open your Internet browser where the SAP Web Assistant Extension is installed. Click on it, and select Settings.

SFSF_Conditions_4.png

Fill out the fields accordingly.

SFSF_Conditions_5-1.png

1 – The URL to the Configuration you copied to the clipboard earlier

2 – The URL(s) to your SAP SuccessFactors system(s) where you want to activate the SAP Companion Conditions

3 – Activate the configuration

4 – Save the configuration

The final step. Seriously. In your SAP SuccessFactors system(s) Companion settings add the parameter useConditions=true into the Parameters field as shown below. Save your changes.

SFSF_Conditions_6.png

If you did everything correctly, then when you’ll first notice, that the SAP Web Assistant Extension is running properly when you are on the SAP SuccessFactors page. The green check mark will be visible.

SFSF_Conditions_10.png

After you open the SAP Companion in the editing mode in SAP SuccessFactors, then you’ll notice a new tab called Conditions in the context help/link tile/guided tour editor.

SFSF_Conditions_7.png

If you want your content to be visible to those who occupy manager positions and have employees reporting to them (direct or matrix), then set the isManager condition to the is true. For employee-only content assign the is false to the isManager condition. For content visible to everyone, just leave the Conditions section blank.

Troubleshooting

To check whether the conditions were applied, open the browser developer tools console and run the command: Help4.API.getConditions() You should see the conditions applied.

SFSF_Conditions_8.png

The script saves conditions in the browser localStorage object to speed up the further assignment process. To check the local storage run the command localStorage. You will see the stored condition+value as well as the current SFSF userId.

SFSF_Conditions_9.png

Conclusion

This is just a first scenario when using SAP Companion conditions might be quite helpful. I also have a slightly more advanced script that also retrieves user location and assigns it as a second condition. I’m sure, there might be tons of other scenarios where the conditions would be helpful.

Kind Regards, Anton


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK