Skip to main content

Notifications

Power Pages - Power Apps Portals
Unanswered

How to strip out authenticated users text from display

(0) ShareShare
ReportReport
Posted on by 7,023

Hello Guys, 

 

In one of the web page I am printing the current user role of the user using liquid template 

 

{{user.roles}}

 

And it display like below. 

 

ragavanrajan_0-1608112920583.png

Is there anyway I can strip out "Authenticated Users"  and add comma (,) between all the web roles. In my case ( Napier, Edison Users) are two web roles. 

Appreciate your input on this.  Thanks 

 

  • OOlashyn Profile Picture
    OOlashyn 3,496 on at
    Re: How to strip out authenticated users text from display

    Hi @ragavanrajan ,

    @Fubar is pointing correctly that user.roles is an array of strings (as per docs), not a string. You need to loop through it:

    {% for role in user.roles %}
    {% comment %}Do something with the role{% endcomment %}
    {{ role }}
    {% endfor %}

     

  • Fubar Profile Picture
    Fubar 7,688 on at
    Re: How to strip out authenticated users text from display

    Are you looping user.roles (as it will probably be an array or collection)

  • ragavanrajan Profile Picture
    ragavanrajan 7,023 on at
    Re: How to strip out authenticated users text from display

    Thank you @Fubar , I tried the string manipulation remove but it is throwing the following error

     

    Liquid error: Object of type 'System.String[]' cannot be converted to type 'System.String'.

     

     

     

     

  • Fubar Profile Picture
    Fubar 7,688 on at
    Re: How to strip out authenticated users text from display

    you can apply Liquid filters to manipulate text etc

    https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-filters#string-filters

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard