Since calling generate_guid creates a new GUID each time, you need to save it as a variable to use the same one for message processing. To generate a new GUID for multiple fields, you would insert the following script in the Global Inbound Script, or Global Outbound Preprocess Script.
For example:
from ifware import guid
# Generates a 128 bit guid (default).
# For example, '40C76A47C600704CDD457D49AA55B94C.'
guid_str = guid.generate_guid()
Note that "guid_str" is a variable that holds the GUID. You can then use "guid_str" in any field you want to generate a GUID for by inserting the following code in the inbound or outbound script:
value = guid_str
This means you can generate a GUID for use in multiple fields for the same message, as shown below: