Pass field value of original node in webform I'm using Drupal 8.7.8 and Webform 5.4.0. I have multiple section nodes that are displayed on course nodes. These are 2 different content types. 

I'm adding webforms to sections, via the twig file conditionally (not all sections) with {{ drupal_entity('webform', 'my_form_id') }} and I need to pass the value of field_code of the section into a hidden field on the webform. 

Once the form is rendered on the course page, the field_code value passed belongs to the course node rather than the section. How can I access the field_code value on the section? 

I tried adding a hidden field with this token as the default [webform_submission:node:field_code:value], which works when I test the form on the section, but when I test the form on the course (where the user will access it) I'm getting the field_code value of the course.

What's the best way to handle this? Is there a way to set the source entity to the content type that the form is on? Please let me know if I need to add more info.

Thanks!
I'm answering this with how I solved it in case anyone else has the same question. Maybe my question could be worded better though...

I was able to get this working with the Webform Node module.

I installed webform node. Then, I added a webform field to my content type. I selected the form I wanted as the default field settings. I selected the "Use this field's Content entity as the webform submission's source entity." checkbox.

I added my form to the display of the nodes I wanted it to be on in the content type's twig:

{% if node.field_name.entity.label == "My condition label" %}
  {{ content.field_name_of_webform_field }}
{% endif %}


Now, on my course page the same form appears for each section and I get the code for the section that the person filled-out the form on in the [webform_submission:source-entity:field_code:value] token!!

A couple of the resources that helped me:
https://www.youtube.com/watch?v=B_ZyCOVKPqA
https://www.webwash.net/moving-forward-webform-drupal-8/#attaching-a-webform-to-a-node