Skip to Content
Author's profile photo Mathew Davis

Hide or change the order of group displayed for a particular user in FIORI 2 dynamically

This blog explains how we can hide or change the order of the group displayed for a particular user in FIORI 2 dynamically.

Scenario: If a user wants to view fiori launchpad with different groups when accessed from different devices. Example: A mobile app which opens fiori launchpad should show only the approval apps even though the user has authorization to many other fiori apps. Another mobile app should show only HCM related apps in the launchpad. So dynamically we have to change the order or we have to hide the group before viewing fiori launchpad.

Solution:  In Fiori 2 there is an option to hide or show the groups from the edit option in the launchpad. So here also we are using the same standard OData service to change the group order or to hide any group. So each time when you call launchpad from the mobile app you should call the below OData service first.

 

Service Detail:

URL: http://<hostname>:<port>/sap/opu/odata/UI2/PAGE_BUILDER_PERS/PageSets(‘%2FUI2%2FFiori2LaunchpadHome’)

Method:    PUT

HEADERS:

X-CSRF-TOKEN = fetch (fetch the token first and place here)

Authorization = username / password

Accept = application/json

Content-Type = application/json

 

BODY:

{“__metadata”:{“type”:”PAGE_BUILDER_PERS.PageSet”},”id”:”/UI2/Fiori2LaunchpadHome”,”configuration”:”{\”order\”:[\”<groupid1>\”,\”<groupid3>\”],\”hiddenGroups\”:[\”<groupid2>\”,\”]}”}

 

Example:

{“__metadata”:{“type”:”PAGE_BUILDER_PERS.PageSet”},”id”:”/UI2/Fiori2LaunchpadHome”,”configuration”:”{\”order\”:[\”/UI2/Fiori2LaunchpadHome\”,\”ZSAP_APPROVAL_BCG\”,\”ZSAP_EMP_Serv\”],\”hiddenGroups\”:[\”SAP_HR_BCG_EMPLOYEE_T\”]}”}

 

Response Status: 204

 

I had a similar requirement, so thought of sharing this solution.

Thank you

Mathew

 

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sander Star
      Sander Star

      Nice example. But where can you embed that piece of code in the launchpad to enable hiding or sorting groups?

      Author's profile photo Mathew Davis
      Mathew Davis
      Blog Post Author

      Hi Sander

      No need to embed this in the launchpad, we have call the service in the blog before calling the launchpad.

      Can you explain your requirement .

       

       

      Regards

      Mathew

      Author's profile photo Sander Star
      Sander Star

      Hi Mathew,

      We have an existing launchpad with tiles. All tiles are exposed for desktop, tablets and phone with the launchpad customizing. Not all apps are mobile ready yet. So we want to provide another launchpad with tiles which are mobile ready.

      We want to use the same launchpad URL maybe with an extra request parameter for mobile usage. This URL will be packaged in a Cordova app.

      In some custom code we want to hide all existing catalog groups and show the mobile tiles in the mobile app. In the existing situation (launchpad URL without request parameter) we want to hide the mobile group.

      This is just a temporary solution till all apps are mobile ready. We don't want to use the launchpad customizing to disable some apps for mobile devices because some apps are already in use.

      So we will have 2 scenario's for the launchpad.

      • Standard launchpad URL with all apps
      • Mobile launchpad URL with request parameter showing only a subset of tiles

      Regards,

      Sander

       

      Author's profile photo Mathew Davis
      Mathew Davis
      Blog Post Author

      Hi Sander

      My understanding is that, you having a custom mobile application in which you calling fiori launchpad.

      One way would be like include the apps that are not mobile ready into a group and hide that group when launchpad is opened from mobile.

      So in your mobile app, call the url as in the blog before opening launchpad.

       

      Regards

      Author's profile photo Sander Star
      Sander Star

      Hi Mathew,

      I understand the above scenario. We can build that in a mobile app.

      1. Login
      2. Do the rest call from above
      3. Open launchpad url

      I was just wondering if you can build that piece of code in the existing launchpad (FioriLaunchpad.html or other components).That would give us more control.

      Regards,

      Sander

      Author's profile photo leri jones
      leri jones

      thanks you for providing this solution. I needed this.

      Facetime App

      Author's profile photo sam jon
      sam jon

      Hi Mathew Davis/Sander,

       

      How can I achieve this one.

      I have same requirement,where have to write this code

       

      [

       

       

      BODY:

      {“__metadata”:{“type”:”PAGE_BUILDER_PERS.PageSet”},”id”:”/UI2/Fiori2LaunchpadHome”,”configuration”:”{\”order\”:[\”<groupid1>\”,\”<groupid3>\”],\”hiddenGroups\”:[\”<groupid2>\”,\”]}”}

       

      Example:

      {“__metadata”:{“type”:”PAGE_BUILDER_PERS.PageSet”},”id”:”/UI2/Fiori2LaunchpadHome”,”configuration”:”{\”order\”:[\”/UI2/Fiori2LaunchpadHome\”,\”ZSAP_APPROVAL_BCG\”,\”ZSAP_EMP_Serv\”],\”hiddenGroups\”:[\”SAP_HR_BCG_EMPLOYEE_T\”]}”}

       

       

      ]

      pls help on this

      Thanks,

      SAM