Replies: 3 comments 3 replies
-
Since I've never used that I don't know a solution from the top of my head, but how about trying it with an |
Beta Was this translation helpful? Give feedback.
-
IIRC the script should look something like this: context.propertiesToUpdate = {
UserProfile: {
ContentType: "UserProfile",
UserProfile: {
FirstName: {
Text: "MyFirstname"
}
}
}
}; |
Beta Was this translation helpful? Give feedback.
-
@gvkries that didn't seem to work either. Maybe it's because the UserProfile property is not getting initially created? Looking at the record in the database I just see "Properties":{} for that newly created user. If I look at a user record that I manually updated in the admin, I see "Properties":{"UserProfile":{"ContentItemId":"4mj5q1j975cnew61evyar7mpdd","ContentItemVersionId":null,"ContentType":"UserProfile","DisplayText":"","Latest":false,"Published":false,"ModifiedUtc":"2024-09-19T13:22:10.5572826Z","PublishedUtc":null,"CreatedUtc":null,"Owner":"","Author":"user+company.com","UserProfile":{"FirstName":{"Text":"first"},"LastName":{"Text":"last"}}}} |
Beta Was this translation helpful? Give feedback.
-
I am using Microsoft Entra ID for user login/registration. I am trying to populate some custom user profile fields (e.g. first and last name) from the external claims that come back from the external login. Ideally I'd like to do this during registration but have not found a way to do that. So I'm using the User Login script and setting the "propertiesToUpdate" field, but it's not actually updating the user. I have a UserProfile content type (with CustomUserSettings for the stereotype) and I can see those fields in the admin, but they do not get updated when logging in. I've tried
context.propertiesToUpdate={ "UserProfile":{ "UserProfile": { "FirstName": { "Text": "MyFirst" }, "LastName": { "Text": "MyLast" } } } };
and a few variations on that. Am I going about this the right way, or is there a better way to accomplish it? I'm not seeing errors - it's just not updating the user record.
Beta Was this translation helpful? Give feedback.
All reactions