Under review

Export custom user fields

Maureen Reinert 5 years ago in BLOX CMS updated by W. Rags. 3 weeks ago 6

Does anyone know how to export the custom fields that we are adding when our users register. I see the data on the Custom tab of the users' accounts, but when I export the users to a csv file the only fields that are exported are

screenname email account_type firstname lastname createtime authtime country address municipality region postcode phone gender birthday

There's nothing in the TN documentation about this. The documentation tells you how to add a custom field to the registration form, but it's not much good if we can't export that information.

Hi Maureen,

Where you able to figure this out?  We too would like better data exporting and ways to enrich our data.  
We currently use Airtable and Zaiper.  We are going to see if we can setup a webhook to update records this way.  Please let me know if you figure out a solution to your original question. 

I found a way, using the API calls.  When you pull a user account info, it has a "custom" array that has your custom items in it.

Are pulling the information for all of your users with the API calls? I've used it to get a single user's custom fields when they get to particular page, but I haven't found a way to get the information for all users in one export. For example, we used a custom field to save a subscriber's high score for a javascript game. When that user comes back to the game, the score is shown. But I don't know how to get a list of all of the users that have saved high scores. If I could see all of the users that have a value set in that field, I would know how many of them played the game.


I use a function to grab all info for a subscriber.  I loop through all of our user, pulling each in and check their custom variable (in my case circid).  The function that pulls in a specific user pulls in all information, subscription, login, services, etc.  I use it for any user information lookup I need so it is fairly generic.  Once you have the screen name, or email address as a search item you can then pull in their entire record and check any of the fields you want.  Just remember that you have to check for a "lack of variable' when looking at custom values.

The code below is old, and was used while I was testing and learning the Townnews API. Bug are mine, but this code does work in 90+% of the time.  Error checking was at a minimum at this point.

Call to function:

Check for 'customer' field (circid is an internal customer id number for one of our tools):

if(isset($sub_arr['custom']['circid'])&&$sub_arr['custom']['circid']!=0) {
//do doemthing
} else {
//do something else

function get_user_info($user_id) {

  //$user_id == screenname or email address
  if(!isset($result_arr['error_code'])) {
  } else {
    //handle error condition
    $user_arr['message']="Error detected. Error is ".print_r($result_arr['error_code'],true)."  \r\n";
  foreach($serv_arr as $service_id) {
    if($service_id>0) {
      for($i=0; $i<100; $i++) {

        if(!isset($resultserv[1])) {
   foreach($resultserv AS $item) {
          if(trim($item['user_uuid'])==trim($user_arr['id'])) {
            if(trim($item['id'])!= "") {
            } else {
          }//end if(trim($item['user_uuid']...
  if($result_arr['is_admin']==1) {
    $user_arr['services'][99999]['name']="Admin access";
  if(isset($user_arr['service'][0]) && is_array($user_arr['service'][0])) { unset($user_arr['service'][0]); }
  return $user_arr;


Sort of.  I use a PHP script to pull a list of subscribers/users then loop through that to download the individual subscriber information.  Pulls about 1000 entries every 3-4 minutes, but I get everything about them that way.  I don't run it often, but when I need a complete list, this is how I do it.