Problem/Motivation
This was fun to debug.
When constructing a webform, we use hidden fields to pass contextual information to salesforce...
Our salesforce admin wanted to track a unique number for each submission, so I made a hidden field that dropped "[random:hash:md5]" in to a hidden input on the form...
The salesforce field this gets mapped to, is "drupal_lead_id__c"
So I initially created a hidden field in webform, called.... "drupal_lead_id__c" ...
No matter what I did, when monitoring the salesforce submit log, you'd see a NULL value in the "Drupal_Lead_ID__c" field.
Entity of type "webform_submission" is being pushed to salesforce "Lead" entity. Drupal entity ID: 1853. Data: @"FirstName":"alphex 017","LastName":"alphex 017","Title":"title 017","Email":"foo+test017@alphex.com","Phone":"+15556667788","Subject__c":"subject 017","LeadSource":"Website","Your_Message__c":"message 017","Company":"company 017","Industry":"EPC","Event_Title__c":"Contact Us","Page_URL__c":"https:\/\/foobar.lndo.site\/contact-us","Drupal_Lead_ID__c":NULL
I even converted this to a plain text field, which I manually typed values in to, thinking maybe the token i was using was putting in a weird hidden character... still sending NULL.
I tried making another hidden field. "random_id_number", and generating a random number there... and then in the "drupal_lead_id__c" webform field, field setting a default value to "[webform_submission:values:random_id_number:raw]" ...
still, the value shown in the logs, and on salesforce, was empty... null.
--- I stepped away from the computer at this point, and went for a walk.
I realized that NONE of the other fields in WEBFORM have the same field name as the salesforce object their pushing to.
*lightbulb*
So I came back, and went to the salesforce mapping screen for the webform, and set the "random_id_number" field in webform, to push to the salesforce "Drupal_Lead_ID__c" field...
And it worked.
---
All I can determine is, that in the salesforce mapping screen...

You can NOT have the "webform element" machine name, be the same as the Salesforce Field Name.
Or, at least -- thats the surface issue I found, maybe its something else.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| screenshot_2025-10-30_at_17_23_30.png | 28.07 KB | alphex |
Comments