question

Tanishq Malu avatar image
Tanishq Malu asked

Fetch Key-Values pairs from User data in which keys follows some conditions(like has certain prefix)

Suppose My user data looks like this: Key: PlayerName, Value : Dave Key: PlayerLevel, Value : 1 Key: PlayerSpeed, Value : 10 Key: PlayerAbility, Value : Water Key: PlayerType, Value : Pre-historic Key: LastPlayed, Value : 23/08/2023 Key: LastUpgrade, Value : 2/08/2023 Key: Lastwin, Value : 23/08/2023

Now I want to fetch only those keys which starts with Player. How can I do that?

apisPlayer Data
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

·
Xiao Zha avatar image
Xiao Zha answered

Currently, PlayFab does not support you to fetch key-values pairs from User Data in which keys follows some conditions (like has certain prefix). You could try putting key-value pairs which keys have the same prefix into one key-value pair, so that you only need to specify one key to get the data. For example, Key: Player, Value: {"Name":"Dave","Level":1,"Speed":10,"Ability":"Water","Type":"Pre-historic"}.

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.

Tanishq Malu avatar image Tanishq Malu commented ·

The trick mentioned by you can surely be used and would be helpful for simple conditions like prefixes and suffixes check. However, A simple string equality check or string contain check can be added as parameter in the API call and that would be helpful for even complex requirements. It

Anyways, thanks for the clarification.

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.