question

Tuomas Karmakallio avatar image
Tuomas Karmakallio asked

Searching playerData for empty fields or NOT EQUALS

We are trying to find players with a custom PlayerData(Title) field : playerLanguage != ES

This syntax does not work however. Is there a search syntax guide somewhere?

Player Data
1 comment
10 |1200

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

Tuomas Karmakallio avatar image Tuomas Karmakallio commented ·

Could I get some information on how this should be done : we suspect some players have missing information in their custom playerData, and want to get information on that. I am reading up on CloudScripts, have installed Postman, and now trying to figure out how we could query them.

pseudocode:


playersWithMissingFieldsIdList = new List<string>;

for (player in AllPlayers){

if (string.IsNullOrEmpty(playerName)) playersWithMissingFieldsIdList.Add(player.id);

if (string.IsNullOrEmpty(playerLanguage)) playersWithMissingFieldsIdList.Add(player.id);

}

return playersWithMissingFieldsIdList;

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

In this case, you can use this statement NOT”ES”. You can click the [SEARCH TIPS] that under the [NEW PLAYER] button in the [Player] page to find some search samples. Please check this doc for the search field list. And you can find the syntax guide link in this doc.


tempsnip.png (62.9 KiB)
11 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.

Tuomas Karmakallio avatar image Tuomas Karmakallio commented ·

Trying:

playerLanguage NOT "ES"

playerLanguage = NOT "ES"

Neither is returning any results.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Tuomas Karmakallio commented ·

Please try

NOT "ES" 
0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Tuomas Karmakallio commented ·

Sorry, I did not explain it clearly. Actually, PlayFab doesn't support using custom data to search the player in the GameManager, but you can use the country where players last login to search players. Please use the NOT"ES" or "ES" directly.

0 Likes 0 ·
Tuomas Karmakallio avatar image Tuomas Karmakallio commented ·

So searching through PlayerData fields is not supported at all? It sometimes works though, for example playerBestScore = "12" works for me. This is very unclear, if it is truly so that custom playerData search is not supported that should be stated clearly in the very beginning of search tips?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Tuomas Karmakallio commented ·

We tried it and the results of searching playerBestScore = "12" and searching "12" are the same. Maybe playerBestScore = doesn't have effects.

0 Likes 0 ·
Tuomas Karmakallio avatar image Tuomas Karmakallio Sarah Zhang commented ·

That doesn't make any sense though, what if I had multiple numeric fields... But OK, I think we can come to the conclusion that we should not rely on searching playerData in any case.

0 Likes 0 ·
Show more comments
Tuomas Karmakallio avatar image Tuomas Karmakallio commented ·

Current 'Search Tips' does not provide a clear syntax guide. Boolean operators for example?

0 Likes 0 ·
Tuomas Karmakallio avatar image Tuomas Karmakallio commented ·

There's something broken in the search system. We have a playerData field called "playerLanguage" with two letter country codes. ( FI, ES for example )

I have a player with "ES" as the language code.

I search with playerLanguage = "FI"

And that returns the player with "ES" as the language code.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Tuomas Karmakallio commented ·

The first thing is playerLanguage can't be used for search. PlayFab doesn't support using player data to search the player in the GameManager. We can only use the fields on this list. You can use the country code "ES", because it is included in the built-in country code list too.

About boolean operators for example. You can refer to the following sample.

// Players who’ve logged with Facebook but did not create an account using Facebook


"Facebook" AND origination:(NOT "Facebook")
0 Likes 0 ·
Tuomas Karmakallio avatar image Tuomas Karmakallio Sarah Zhang commented ·

Could I get some information on how this should be done : we suspect some players have missing information in their custom playerData, and want to get information on that. I am reading up on CloudScripts, have installed Postman, and now trying to figure out how we could query them.

pseudocode:


playersWithMissingFieldsIdList = new List<string>;

for (player in AllPlayers){

if (string.IsNullOrEmpty(playerName)) playersWithMissingFieldsIdList.Add(player.id);

if (string.IsNullOrEmpty(playerLanguage)) playersWithMissingFieldsIdList.Add(player.id);

}

return playersWithMissingFieldsIdList;

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.