question

Mahnoor Naeem avatar image
Mahnoor Naeem asked

I am entering Player Data(title) from unity. It accepts string as value. But only numbers in string else it Invalid Input Error. Can you please help? I cannot store alphanumeric data in player data field.

Player DataTitle 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.

Mahnoor Naeem avatar image
Mahnoor Naeem answered

I guess I found the answer, I mistakenly tick marked above condition in API Features. which demanded me to put correct json in Data.

Sorry for the trouble.

And thankyou for your time and help.


answer.png (108.6 KiB)
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.

Roshaan avatar image Roshaan commented ·

@Mahnoor Naeem oh that didn't came into my mind.

That's great that now your problem is resolved :)

And sure no problem. Have a great day!

1 Like 1 ·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

Can you post your code and the exact error you're getting?

7 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.

Mahnoor Naeem avatar image Mahnoor Naeem commented ·

this is the code

PlayFabServerAPI.UpdateUserReadOnlyData(

new PlayFab.ServerModels.UpdateUserDataRequest { PlayFabId = agentID, Data = new Dictionary<string, string>() { {"MyPlayers", "mahnoor"}, },

Permission = PlayFab.ServerModels.UserDataPermission.Public },

result => { Debug.Log("Data Updated"); },

error => {

Debug.Log( error.ErrorMessage);

} ) ;

This is the error I get:

Invalid input parameters UnityEngine.Debug:Log(Object)

But if I replace "mahnoor" with some numbers like "236438" then data will be updated.

0 Likes 0 ·
Roshaan avatar image Roshaan Mahnoor Naeem commented ·

@Mahnoor Naeem Can you please post the playfab error code?

0 Likes 0 ·
Mahnoor Naeem avatar image Mahnoor Naeem Roshaan commented ·

The value for key MyPlayers was not valid JSON.

this is the error I got from error detail

I dont know the error code, but http code is 400.

0 Likes 0 ·
Show more comments
Mahnoor Naeem avatar image
Mahnoor Naeem answered

These errors are given by your code above.

As far as I tested it, it only accepts numbers in string.Because even in your code when I entered "1234556" as value, it got updated. as below.


error.png (38.6 KiB)
ss.png (14.9 KiB)
15 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.

Mahnoor Naeem avatar image Mahnoor Naeem commented ·
@Roshaan

..

.

0 Likes 0 ·
Roshaan avatar image Roshaan Mahnoor Naeem commented ·

@Mahnoor Naeem
Let me check this and get back to you. To me it's very strange.

1 Like 1 ·
Roshaan avatar image Roshaan commented ·
@Mahnoor Naeem

The same code is working for me. Can you please share your own code so I could test it on my end and see if it's working

0 Likes 0 ·
Roshaan avatar image Roshaan Roshaan commented ·

@Mahnoor Naeem
I used your own code mentioned in the first comment and it's working for me.

I am attaching a screenshot too and I tried to enter two values "123456" & "mahnoor" both can be seen in the picture that they are inserted successfully

0 Likes 0 ·
Mahnoor Naeem avatar image Mahnoor Naeem Roshaan commented ·

I used same code as you posted. Mine is also posted above that.

0 Likes 0 ·
Roshaan avatar image Roshaan Mahnoor Naeem commented ·

@Mahnoor Naeem

I have used your code and it's working See the above comment

0 Likes 0 ·
Show more comments
Show more comments

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.