System Keys. user.email works but user.id is NULL


#1

Hi, I refer to System Keys as described here

http://wiki.dreamfactory.com/DreamFactory/Features/Lookups

I am using several of these in a script like this

var user_data;
var user = event.request.payload;

user_data ={‘resource’: [ { ‘DFUserID’ : user.id,‘FirstName’: user.first_name, ‘LastName’: user.last_name, ‘Email’:user.email, ‘KnownAs’: user.display_name } ] };

var send = platform.api.post(“hiyerDB/_table/Users?fields=FirstName,LastName”, user_data)

However user.email returns the email but user.id, which I assume to be the ID field if one goes to Users in the DF Admin panel, returns NULL.

In my script I had assumed the line …

var user = event.request.payload

…allows access to all system variables starting with user (such as user.email, user.first_name and therefore user.id), but I now think it only allows access to those parameters that were POSTed in the registration process, which does not include user.id since at the time of POSTing it is not defined.

So how do we access user.id? Indeed how do we access any of the other System Keys such as session.token for use in a script?