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.
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
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 %}
Are you looping user.roles (as it will probably be an array or collection)
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'.
you can apply Liquid filters to manipulate text etc
https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-filters#string-filters