1

Essentially, I need a button, or some other mechanism, to send users to different lists depending on the user's name. I've accomplished this with a Power App embedded into the SharePoint page, where I used the Launch() function with a button.

However, embedded Power Apps are clunky and don't necessarily fit into the theme of a SharePoint site, and I would much prefer if this was somehow possible with other web parts.

Is there a way to accomplish this? Thanks much.

1
  • What is the logic/conditions based on user name to send them to different lists? Unfortunately, SharePoint does not provide any out of the box web part to write customized logic or JavaScript for such requirements. Commented Aug 8, 2023 at 11:14

1 Answer 1

0

Unfortunately, SharePoint does not provide any out of the box web part to write customized logic or JavaScript for such requirements.

Here is the list of web parts supported out of the box in SharePoint online modern experience: Using web parts on SharePoint pages

Here are some recommendations which might work for you.

  1. When you embed Power Apps in SharePoint page, you have to provide the URL of application inside Power Apps web part settings. You can pass the query string parameters with the application URL which you can read in your Power Apps using Param function. You can either pass the color name or pass the SharePoint theme name and based on that you can change the colors in the application. Check default themes, colors and theme generator for more information: SharePoint site theming

  2. If you have to conditional logic based on "group" of users, you can use Quick links web part and audience targeting in SharePoint - you will need Azure AD or M365 groups for audience targetting.

  3. Try Modern Script editor web part using which you can add custom HTML, CSS and JS on SharePoint modern pages. You can write your own code to customize the display (color, background color, etc.) of buttons. For example: Current user context in SharePoint modern page

  4. Develop custom SPFx web part for showing buttons on the SharePoint modern pages. SPFx is Microsoft recommended custom web part development tool which gives you more flexibility and control over coding you can use to show the buttons on page. You can also customize the display based on currently set SharePoint site theme. Check:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.