Create new user with Country

I want to create a user with Country.Below is the code.

I do not see a member for country in the UserProfile class. Link for available methods

// Create a user with the specified password
var vader = await client.Users.CreateUserAsync(new CreateUserWithPasswordOptions
// User profile object
Profile = new UserProfile
FirstName = “Test1”,
LastName = “Okta”,
Email = "",
Login = "",
Country = “United States”, //error - ‘UserProfile’ does not contain method definition for country
SecondEmail ="",
MobilePhone = “1234567890”
Password = “aasdhaweq”,
Activate = false,

Can someone advise?

You need to update the user profile with a custom attribute.
You can either do it through API -

Or you can login as admin to your org and navigate to Users -> Profile Editor and click on profile to add new property.

Hi Vijet, I have the country already in the profile Schema. The problem I am facing is with the UserProfile api .

when I am creating the user through my code I can’t find the method for Country on the UserProfile. UserProfile has only these:

Hi @amarvemula,

If I am not wrong, you need to use the UserBuilder Class in the Java SDK.