Custom fields

You can assign a custom field to a partner to assign a unique ID to the partner. This unique ID, when used with a REST API in an activity, can enable the activity to extract partner-specific information from a third-party system.

Consider a partner whose information is maintained in a third-party system and a REST API call from IBM PEM to the third-party system's REST server requires an ID that uniquely identifies this partner. The sponsor can set the ID for each partner with a custom field that is defined for each partner. When the partner runs an activity that calls this REST API, the ID that is set for this partner is sent as part of the request to the REST server.

You can also define a custom field task in an activity. When the activity is run, it can map the responses from a third party API into custom field values, and assign the custom field values to the partner. This is done by adding a Custom Fields task to the activity. For more information, see Mapping an API response to a custom field.
Note: To check the custom fields mapping at any time after the mapping is done, you can right-click on the custom fields task and click View.
The sponsor must set up the custom field with a regular expression that includes all possible and valid values that the partner can have for that custom field. For example, if you create a custom field that must take a nine-digit number, then the regular expression for this field is [0-9]. A custom field has a defined name that is associated with a value.
Important: The value must match the regular expression that was entered when the custom field was defined.
The following example shows the custom field field1 being assigned the value value1, and the custom fields field2 and field3 being assigned the values value2 and value3:

	<customFields>
		<customField name="field1" value= "value1\"/>
              <customField name="field2" value= "value2"/>
		<customField name="field3" value= "value3"/>
	</customFields>

The number of active custom fields that is allowed is limited to 100. All custom fields that are used in test mode have test as the default value.

Custom fields can be deactivated and activated again. A deactivated custom field cannot be assigned to a partner and cannot be used in a new activity for component mapping.

The Sponsor Administrator first needs to create a custom field before it can be assigned to a partner. Custom fields are assigned to a partner in the Custom Fields tab under Settings, by performing a bulk upload with a REST API, or with a Custom Fields Task in an activity. Custom fields assigned in an activity can be viewed by right-clicking on the Custom Field task in the activity and selecting View.

Custom fields that are created in a sponsor domain are available for mapping to components, so that the value of the custom field for a partner can be accessed within an activity. Only active custom fields can be mapped.

Exporting an activity with custom fields as a template adds the custom field name to the XML wherever it is used in the activity mapping. However, exporting an activity removes the custom field mappings, so when the activity with custom fields is imported, you need to create the custom fields and assign values to partners for these fields.

REST API example

The following REST API example adds custom fields named field1, field2, and field3 to the partner company BigCorp that is being added.
<create userId="abc_pem@ibm.com" nameOfCompany="IBM" answer="IBM" 
businessRole="manager" comments="123456789" city="springfield" country="US" 
email="abc@customer.com" firstName="abc" furtherContacts="" 
headOfficePhone="1234567890" lastName="pem" mobilePhone="0987654321"  
officePhone="4567890123" question="company?" state="ohio" 
streetAddress="123 Mystreet"  website="www.ibm.com" zipCode="45678">

  <customFields>  
      <customField name="field1" value= "value1\"/>  
      <customField name="field2" value= "value2"/>  
      <customField name="field3" value= "value3"/>
  </customFields>   
  
  <vchRestAttributeTypes>
    <vchrestattributetype attrTypeName="attr1">
      <vchAttributeValues>
        <vchrestattributevalue attrValue="aaa"/>
        <vchrestattributevalue attrValue="bbb"/>
      </vchAttributeValues>
    </vchrestattributetype>
  </vchRestAttributeTypes>

</create>

Regular expression example 1

The regular expression for a custom field Currency that accepts values only from a fixed set of currency types (dollar, pound, rupee) is:

(dollar|pound|rupee)

Regular expression example 2

The regular expression for a custom field DUNS that takes a nine digit number is:

[0-9]