question

heikohufnagl avatar image
heikohufnagl asked

GetPlayerCombinedInfo - TotalValueToDateInUSD undefined

I use GetPlayerCombinedInfo to get various player data:

var profileConstraints = {};

profileConstraints.ShowTotalValueToDateInUsd = true;

var combinedInfo = server.GetPlayerCombinedInfo({PlayFabId: currentPlayerId, InfoRequestParameters: {

GetUserInventory: true,

GetUserVirtualCurrency: true,

GetUserReadOnlyData: true,

UserReadOnlyDataKeys: ["xxx", "xxxx"],

GetTitleData: true, TitleDataKeys: ["x"],

GetPlayerProfile: true,

ProfileConstraints: profileConstraints,

GetPlayerStatistics: true,

PlayerStatisticNames: ["x", "xx"]}});

It all works perfectly, but combinedInfo.InfoResultPayload.PlayerProfile.TotalValueToDateInUSD

is undefined, i expected at list a value of 0.

I check which properties combinedInfo.InfoResultPayload.PlayerProfile has, the result is:

PublisherId

TitleId

PlayerId

but TotalValueToDateInUSD is missing.

Can you help, please?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Indeed, it does appear that if the player has made no purchases at all, there hasn't been a VTD set in the player profile yet, which would result in no TotalValueToDateInUSD being returned. For now, you can assume that if TotalValueToDateInUSD is null (not returned), it is 0. I'll open a bug to have it returned with a value of 0 for that case.

9 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

heikohufnagl avatar image heikohufnagl commented ·

Thank you for caring about this, Brendan. Btw I've read it in some other forum entries already... it would be extremely useful if GetPlayerCombinedInfo could deliver players internal data, too!

0 Likes 0 ·
pdaz avatar image pdaz commented ·

TotalValueToDateInUSD is null even if player bought something. Checked both in client and server API.

var GetPlayerCombinedInfoRequest = {
        "PlayFabId": currentPlayerId,
        "InfoRequestParameters": {
        	"GetUserAccountInfo": true,
        	"GetUserInventory": true,
        	"GetUserReadOnlyData": true,
        	"UserReadOnlyDataKeys": [
        		"OfferTracker"
        	],
        	"GetPlayerProfile": true
        }
    };
    var GetPlayerCombinedInfoResult = server.GetPlayerCombinedInfo(GetPlayerCombinedInfoRequest);
    log.info(GetPlayerCombinedInfoResult.InfoResultPayload.PlayerProfile.TotalValueToDateInUSD);
0 Likes 0 ·
brendan avatar image brendan pdaz commented ·

Can you give us the specific Title ID and PlaYFab ID, so that we can have a look?

0 Likes 0 ·
pdaz avatar image pdaz brendan commented ·

Title ID is 1941 and player ID is 992CD775E659BB48

0 Likes 0 ·
Show more comments
Show more comments
heikohufnagl avatar image heikohufnagl commented ·

Still getting undefined value for TotalValueToDateInUSD instead of 0, should this have been fixed already, too?

0 Likes 0 ·
brendan avatar image brendan heikohufnagl commented ·

Can you provide the call you're making, including what you're passing in for the ProfileConstraints?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.