Develop > Controller layer > Application developer > Member subsystem


Define custom attributes for member URLs

Overview

Custom attributes for the URLs...

...can be defined using the MBRATTR and MBRATTRVAL database tables,...


Define a custom member attribute

  1. Add the entry to the MBRATTR table. The columns of the MBRATTR table are...

    Column name Description
    MBRATTR_ID Primary key of this MBRATTR table.
    ATTRTYPE_ID Type of the member attribute; foreign key to ATTRTYPE table.
    NAME Name of the member attribute.
    DESCRIPTION Description of the member attribute.

  2. To create a new attribute called corporateemail we can create the entry in the MBRATTR table...

      insert into MBRATTR values (1,'STRING','corporateemail',NULL)

  3. Now that you have the custom attribute, you can use it in the registration flow. The values for these attributes are stored in the MBRATTRVAL table. The type of the attribute will dictate what columns get filled.

    Column name Description
    MBRATTRVAL_ID Primary key for this table.
    STOREENT_ID The store entity to which this attribute value for this member applies.
    MEMBER_ID The member to which this attribute value applies. Foreign key to the MEMBER table.
    ATTRTYPE_ID Type of the member attribute value. Foreign key to the ATTRTYPE table.
    MBRATTR_ID The attribute that this value is associated with. Foreign key to the MBRATTR table.
    FLOATVALUE If the type of the attribute value is FLOAT, then this column will hold the attribute value. If the type is not FLOAT then this column will be NULL.
    INTEGERVALUE If the type of the attribute value is INTEGER, then this column will hold the attribute value. If the type is not INTEGER then this column will be NULL.
    STRINGVALUE If the type of the attribute value is STRING, then this column will hold the attribute value. If the type is not STRING then this column will be NULL.
    DATETIMEVALUE If the type of the attribute value is TIMESTAMP, then this column will hold the attribute value. If the type is not TIMESTAMP then this column will be NULL.


Use custom attributes in the registration flow

See also:

Verify the attributes are defined in the MBRATTR table; then you can use them by adding parameters to the request...

Where:


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:

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 to capture different values for the same attribute, depending on the store:

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:

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:

  1. 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

  2. Run the following command:

      https://host/webapp/wcs/stores/servlet/UserRegistrationAdd/UserRegistrationAdd?logonId=user1&logonPassword=letme5in&logonPasswordVerify=letme5in&URL=/&color_null_a_null=blue

  3. 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


Example 4: Checkbox values

To have a list of checkboxes that can be updated when the user updates their profile, add each interest area as a value in the MBRATTR table. When storing information, instead of setting a default value of null, set a default value of 0 for not selected, and a value of 1 for selected.


Related reference

MemberRegistrationAttributes XML and DTD files
Member subsystem URLs
Authentication data model


+

Search Tips   |   Advanced Search