Update user from external script

It sounds like you are updating the user information after the form has been displayed. You need to rearrange your code so that you are updating the user information earlier, before the form is displayed.

If you need help figuring out how to do that, then you need to share some more details about how you are doing it now.