Hello All,
I was wondering If it is possible to get just the Display Name from a user account in a cloudscript. I am currently working on a project where I need to make an api call that includes the users display name. However, everything I am trying is not giving just the display name.
For example: in my azure function I can say:
public static class PlayfabRequest { [FunctionName("PlayfabRequest")] public static async Task<dynamic> Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = null)] HttpRequestMessage req, ILogger log) { /* Create the function execution's context through the request */ var context = await FunctionContext<dynamic>.Create(req); var args = context.FunctionArgument; var GetPlayerData = new GetPlayerProfileRequest { PlayFabId = context.CallerEntityProfile.Lineage.MasterPlayerAccountId, }; var serverApi = new PlayFabServerInstanceAPI(context.ApiSettings, context.AuthenticationContext); return await serverApi.GetPlayerProfileAsync(GetPlayerData); } }
I am returning:
Result: {"result":{"playerProfile":{"adCampaignAttributions":null,"avatarUrl":null,"bannedUntil":null,"contactEmailAddresses":null,"created":null,"displayName":"g.gji.wam","experimentVariants":null,"lastLogin":null,"linkedAccounts":null,"locations":null,"memberships":null,"origination":null,"playerId":"EAD936D301EC0DC","publisherId":"3F50A3858CE1D5DA","pushNotificationRegistrations":null,"statistics":null,"tags":null,"titleId":"D1EA1","totalValueToDateInUSD":null,"valuesToDate":null}},"customData":null,"error":null}
Which is great because I know its getting the info, however, I want to save "DisplayName" information into a variable on the function to use.
Any thoughts?