How to get a CiviRule to fill in a custom field upon a webform submission?
You will probably need to develop an action that can take that ID from the data coming into the action and set it. There is a standard action to update a custom field (Set Custom Field) but it will ask for a value and will not be able to pick up the value from the input just like that.
Developing your own action is documented here: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/
An alternative might be to use the Form Processor extension, and pick up the ID from the incoming data like that. Check the documentation here: https://docs.civicrm.org/formprocessor/en/latest/