I am creating a Webform (with CiviCRM) attached to a node programmatically. When the function is invoked the node is created, the webform is created, the webform is associated with the node reference, and then I pace data into the Webform. To get data into the Webform I use webform_submission->setData($data);. In this case $data is an array with key values. For example, something like this
$data = [ 'drupal_uid' => $uid, 'civicrm_id' => $civicrm_id, 'language' => $language_id, 'event_id' => $event_id, 'membership_type_id' => $membership_type_id, ];
In my code I also have civicrm_1_participant_1_participant_event_id. When I fill this field with the event ID from CiviCRM it does not change the displayed value of the field. If I run through the form when not initiating it with my code I get a value like "114-12". I know that 114 is the event ID but I do not know what 12 is.
My goal is for this field to show the event the contact is getting signed up for before they press next to pay. Knowing what the 12 is might be enough for me to populate the correct value.