MSGraph – Is it possible to slice an attribute called from an API?



I am using MGT (Microsoft Graph Toolkit) and was wondering if it was possible to slice an attribute.
Here is my code:

                <mgt-person person-query="me">
                <template data-type="loading">

person.DisplayName Returns : "Smith, John"

How do just get the first name from this? I want to slice out the last name and the ",".

I know {{person.givenName}} will give you the first name but for various reasons, some users have a different name in their display name they prefer to be called by.

Please help.


You could use js to achieve this:


Answered By – Michael Han_MSFT

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More