Forum Discussion

Claudius's avatar
10 years ago

Identifying partially completed profiles

I'm currently investigating the use of deferred profile completion, e.g. auto-create partially completed community profiles based on our SSO login. The problem here is that some of our custom components require profile information - display name in particular - that is only available on completed user profiles .

I'm currently looking for ways to detect if a user's profile is only partially completed and I'm checking the registration completed property.

 

It tried to identify via the user Freemarker context object and checking for

 user.anonymous == false && user.registered == false

 

(since I expected an incompleted profile to be non-anonymous, but not registered yet), but unfortunately a partially registered user is user.registered :(

 

Anyone knows a different - ideally non-API reliant - way to determine that partially registered profile status?

  • It was easier than I thought. Just check if the name is already populated:

    <#if user.login != "">

     

  • luk's avatar
    luk
    10 years ago

    I successfully used also:

    <#if (!user.anonymous && !user.registration.complete)>
        // your logic
    </#if>


    not sure if user.login is reliable =), but as often there are many ways to solve a problem!

8 Replies

  • It was easier than I thought. Just check if the name is already populated:

    <#if user.login != "">

     

  • luk's avatar
    luk
    Boss
    10 years ago

    I successfully used also:

    <#if (!user.anonymous && !user.registration.complete)>
        // your logic
    </#if>


    not sure if user.login is reliable =), but as often there are many ways to solve a problem!

  • Thanks for sharing this. If "user.registration.complete" would've been documented I might have found this as well :) Where did you get that info from?
  • luk's avatar
    luk
    Boss
    10 years ago

    True...maybe SuzieH can do something about this missing docs-information?

    I figured it out from the REST API (v1) call here: http://community.lithium.com/t5/Community-API/bd-p/developers-rest-api?leaf-id=User.registration.completed#User.registration.completed

    so I thought if that's available, why not try it directly on the user object in FreeMarker and it worked =)

     

    EDIT: As you have found that link as well, you were actually very close, Lith just sometime needs a shot in the dark for stuff like that and sometimes it also works =D

     

    EDIT2: It would actually be interesting to know if getting that information is also possible via API v2? I couldn't find a direct "completed" property, but v2 returns a block like that:

     

    "registration_data" : {
            "type" : "registration_data",
            "registration_time" : "2015-01-19T15:17:42.213+01:00",
            "status" : "fully-registered",
            "registration_access_level" : "all",
            "confirm_email_status" : true
    },

    so would maybe the status give an indication if a user has completed the registration or not?

     

    EDIT3: Answering my own question...indeed, the "status" property of the registration_data node would give back "PARTIALLY_REGISTERED" (probably lower case if I look at above response...) according to the docs here: http://community.lithium.com/t5/Community-API-v2/User-resource/ta-p/152628

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    10 years ago

    Thanks luk. I can certainly update the user context object documentation. First I want to check that there wasn't a good reason that we didn't expose it publicly.  I'll check with Engineering to see that we're not missing any more useful methods on there. 

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    10 years ago

    luk and Claudius,

    The user context docs are updated. I also uncovered user.subscriptionPageUrl to retrieve the subscription page for the user -- it's now documented as well. 

  • Dani's avatar
    Dani
    Advisor
    9 years ago

    Appreciate finding this thread!

     

    Has anyone documented how they would go back and auto populate all or some of the partially registered users with a random user id?

     

    Thanks in advance!

    Dani

  • luk's avatar
    luk
    Boss
    9 years ago
    Never tried that, would be interested if you manage to do so =)