Defining custom attributes for member URLs
The steps on this page describe how to define custom attributes for member URLs
About this task
Custom attributes for the OrgEntityAdd, OrgEntityUpdate, UserRegistrationAdd, and UserRegistrationUpdate URLs can be defined using the MBRATTR and MBRATTRVAL database tables, as follows:
- The MBRATTR table supports the definition of custom attribute types.
- The MBRATTRVAL table is where the values for these custom defined attribute types get persisted.
To define a custom member attribute:
Procedure
Results
Using custom attributes in the registration flow
Refer to the links below for descriptions of, and information about how to add custom attribute to the command request for, the UserRegistrationAdd or UserRegistrationUpdate commands. You must first ensure that the attributes are defined in the MBRATTR table; then you can use them by adding parameters to the request in the following format:
& attributeName_storeId_action_number=value
Where:
- attributeName
- Matches the NAME column in the MBRATTR table.
- storeId
- The STOREENT_ID of the store (from the STOREENT table). "null" can be used to specify that the attribute is store independent.
- action
- Can be either a (for add), r (for replace) or d (for delete).
- number
- An attribute that can be used if you want to store multiple values for the same attribute.
Example 1: Corporate e-mail
The first example is the corporate e-mail attribute that was created earlier. To add a corporate e-mail value, add the following parameter:
&corporateemail_null_a_null=myemail
This creates an entry in the MBRATTRVAL table with the value myemail in the STRINGVALUE column.
Example 2: Corporate e-mail, store specific
The second example uses the same attribute, but now we store it in a store dependent way. This is useful if you want to capture different values for the same attribute, depending on the store:
&corporateemail_10001_a_null=myemail
This would again create an entry in the MBRATTRVAL table with the value myemail in the STRINGVALUE columnf, but would also add the store identifier 10001 to the STOREENT_ID column.
Example 3: Corporate e-mail, multi-valued
The third example again builds on the previous example, but supporting multiple values for the same attribute:
&corporateemail_10001_a_1=myemail&corporateemail_10001_a_2=myemail2
This creates two entries in the MBRATTRVAL table, the first storing myemail in the STRINGVALUE column, the second storing myemail2 in the STRINGVALUE column.
The following is an example showing how the custom attribute blue is populated in the database:
- After adding the attribute color to the
MBRATTR table, the following information is available from the MBRATTR
table:
- MBRATTR_ID: -28
- ATTRTYPE_ID: STRING
- NAME: color
- Run the following command:
https://myhostname/webapp/wcs/stores/servlet/UserRegistrationAdd/UserRegistrationAdd?logonId=user1&logonPassword=letme5in&logonPasswordVerify=letme5in&URL=/&color_null_a_null=blue
- After running the command, the attribute value blue is
populated in the MBRATTRVAL table:
- MBRATTRVAL_ID: 10001
- MEMBER_ID: -2
- ATTRTYPE_ID: STRING
- MBRATTR_ID: -28
- STRINGVALUE: blue