What variables (if any) are available when populating a field with Evaluate PHP?

For example, in a Durpal User to SF Contact fieldmap, I'm trying to write a query that would populate a field with the user's role, so I need to know at least the users uid (not the currently logged in user, but the user being updated). Is that variable available?

Comments

balsama’s picture

Status: Active » Closed (works as designed)

Just realized that I can use $_POST values from the form in question (user_profile_form in my case).

Never mind...

texas-bronius’s picture

StatusFileSize
new29.81 KB

It's a worthy question. Stepping through module code, looks like at least two useful variables are available:
$drupal_data is the Drupal node loaded to feed your SFDC integration. Consider concatenating two fields like first and last name here-- is there a better place?
$map represents the Drupal -> SFDC field mapping definition

With devel module enabled, you can slyly insert a kpr($drupal_data); before your return value in a php evaluation field. Something like the attached screenshot example.