Forum Discussion

teknetik's avatar
12 years ago

Storing Custom user data

I would like to store some custom data within Lithium specific to each user.

 

Any advice on doing this, has anyone done anything similar.

 

My initial idea was to store this as a JSON string as an admin note but I cannot see a REST Method to achieve this.

 

Anyother smart ideas? I am trying to avoid having to call an external server at this point as the data storage space for each user would only be a few hundered characters at best.

2 Replies

  • PaoloT's avatar
    PaoloT
    Lithium Alumni (Retired)
    12 years ago

    Hi,

     

    in Lithium you can associate custom profile fields to users. This needs to be set up in the platform before you can do it. Normally you would specify the field name and what the data validation rule is. You can ask Lithium Support to create one for you once you have decided what you want to store and how.

     

    To get an idea on what your current user has stored against his profile, you can use this rest call when you are logged in, which will return the user profiles for the currently logged in user (assuming he has permission to do that)

    http://<community url>/restapi/vc/users/self/profiles

     

    I'd also have a look at the documentation for setting a profile via REST. This should help in determining wheter this is a suitable choice for what you are trying to achieve.

     

    Hope this helps,