auth0.users.updateAppMetadata() in action

Ready to post? :mag: First, try searching for your answer.

Hi Team,

I am looking on alternative for auth0.users.updateAppMetadata(user.user_id, appMetadata) and auth0.users.updateUserMetadatda(user.user_id, userMetadata). Is this still available in auth0 action.

This is something i am using for linking users in rules.

Can u pls help me, how to handle this in auth0 action!

Thanks,

Hey there @ganesh.kumaresan !

In Actions you can use the api object to both set userMetadata and appMetadata:

Thanks Tyf,

I understand that we could update/add field in app/user metadata. But I believe auth0.users.updateAppMetadata() replace user’s entire meta data. Is there any possible way to replace the entire meta data in auth0 actions which auth0.users.updateAppMetadata() do in rules!

Gotcha, thanks for clarifying!

There isn’t a way to delete/replace metadata in that way using the api object in Actions - You’ll want to instead use the Management API in your Action for additional functionality:

https://community.auth0.com/t/using-the-management-api-in-actions/64947

Thank you @ty.frith for the clear explanation on this!