Graph JS > Tutorial > Update user

The following example shows two different ways how to update user (or any other item). In the first case (solution1) we create a new User object (updateUser) and set only properties we want to update (JobTitle) and also set the Id property with the same value of Id property as User object we want to update. The method UpdateUser updates only changed properties (JobTitle). In the second case (solution2) we change directly properties on the existing user object (alice) and with parameter updatePropertyNameList we tell the method UpdateUser which properties to update.

Need help? Ask our developers: