Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
How can I get the date of birth for a user?

I am looking to get the date of birth for an end user, but I'm not seeing it populated in the self.online_user.demographic_info.

Posted 4 years ago
Paden Rose
77 × 1 Administrator
Votes Newest

Answers


The date of birth (dob) for an end user is not something that is typically populated by Q2, and it is not included on the incoming request. There is a dob column on the Q2_User table in the database, but this is often NULL since (as of today at least) Q2 does not have a process for populating that column. To get a date of birth, a core call is typically required.

The suggested workflow for getting the dob is this:

  1. Using the User DbObject and the user_id in self.online_user.user_id, query the database for the user row.
  2. Check to see if the dob column is returned and if it is populated (HQ will not send NULL columns in database queries, so use the python function hasatter to see if the dob was returned)
  3. If the dob was not returned, make a core call to fetch the dob via a demographics call.
  4. using the User DbObject, update the dob column for the user with the dob that was returned from the core call.

One thing to point out is that the self.online_user.demographic_info is populated from the incoming request, and contains the same information that the self.online_user has. The purpose of this object is for convence, if you needed to update demogrpahic information (which takes a demogrpahic object), you already have an object pre populated with the end users info.

Posted 4 years ago
Paden Rose
77 × 1 Administrator
148 Views
1 Answer
4 years ago
4 years ago
Tags