Text area field

The text area field is a multiline text control that can contain an essentially unlimited number of characters. If a field is designed to hold a relatively small number of characters (e.g., a user’s first name) then you typically use a text input field. If you need to collect a larger number of characters (for example, a field that asks users to enter a biographical sketch) use a text area field instead. If users need more room to enter information, they can click and hold the resizing handle in the lower right corner of the text area and make the control any size they desire.


Text area attributes and terminology

The text area field, like other [Identity Cloud fields and forms, provides a number of attributes you can use when creating and formatting the field. Also like other Identity Cloud fields, the terminology used to represent these attributes in Console’s Registration Builder sometimes differs from the terminology required when using the Configuration APIs which, in turn, sometimes differs from the terminology used if you view the underlying flow. 

Needless to say, that can be a little confusing. With that in mind, the following table shows the different text area attributes and how they are referenced in Registration Builder, the Configuration API, and the flow; click the appropriate link in the flow column for more information about that attribute. Attributes highlighted in yellow are auto-generated when the field is created, and shouldn’t be referenced when making an API call (and can’t be accessed in Registration Builder).

Option used in Registration BuilderMember used when making an API callProperty name used in the flow
Namenamename
Field Typeetypetype
Schema AttributeschemaAttributeschemaId
LabellabelLabel
Placeholder Textplaceholderplaceholder
Tiptiptip
Prep-populate with data from identity providersocialProfileDataengageData
Submit blank field values as nuemptyMeansNullemptyMeansNull
Ignore updates submitted to this fieldignoreUpdateignoreUpdate
Data Validationsvalidationvalidation
Formsformsforms
element

Create a text area field by using the Configuration API

If you’re using the Configuration APIs to create a text area field, you must include all the desired attributes and attribute values within the request body of your API call. That request body will look similar to one shown below (depending, of course, on the number of attributes you use). For example:

{
     "type": "textarea",
     "name": "testFieldTextArea",
     "schemaAttribute": "displayName",
     "label": {
          "key": "3d43b06fe00fa7cdc32e45ecc8399239"
     },
     "tip": {
          "key": "f8076f1e5f8e5a697d3663a9f1dda799"
     },
     "socialProfileData": "profile.aboutMe",
     "emptyMeansNull": false,
     "ignoreUpdate": false,
     "placeholder": {
          "key": "3d43b06fe00fa7cdc32e45ecc8399239"
     },
     "forms": [
          "traditionalRegistrationForm"
     ]
 }

If you’re using Postman, your request body will look like this:

There are at least three things to keep in mind when creating the request body:

  • The request body must be formatted using JSON (JavaScript Object Notation). If you get the following error, that often means that your request body isn’t using valid JSON:

    400 Bad Request. The browser (or proxy) sent a request that this server could not understand.
    
  • The label and tip attributes must be formatted as JSON objects; that is, you must start with the attribute name (e.g., tip) followed by a colon and a set of curly braces ({ }). Inside those curly braces, use the key member followed by the id of a translation key containing the text you want to use for the label/tip. For example:

    "label": {"key": "352a99f1e9442568706468966749f1e9"}
    

    Note that you must reference a translation key (i.e., a  previously-defined piece of text) when creating a label or tip. Suppose you try defining your text within the API call itself:

    "label": "Newsletter Subscription"
    

    That’s going to result in an invalid syntax error. Instead, you must use the ID of an existing translation key. If you don't have a translation key that reads Newsletter Subscription then you'll need to create one before creating your text area field.

  • The forms attribute must be formatted as a JSON array, with the form names configured as a comma-separated list between square brackets. For example,

    "forms": ["traditionalRegistrationForm", "socialRegistrationForm"]
    

A complete Curl command for creating a text area field will look something like this:

curl -L -X POST \
  'https://v1.api.us.janrain.com/config/79y4mqf2rt3bxs378kw5479xdu/flows/fieldExamples/fields' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Basic eTR4Zmc2ZjQ0bXNhYzN2ZXBqanZ4Z2d6dnQzZTNzazk6OTVjY3hrN2N6YnZ1eng2ZHB0ZTVrOXA2ZGo1Ynpla3U=' \
  --data-raw ' {
     "type": "textarea",
     "name": "testFieldTextArea",
     "schemaAttribute": "displayName",
     "label": {
          "key": "3d43b06fe00fa7cdc32e45ecc8399239"
       },
     "tip": {
          "key": "f8076f1e5f8e5a697d3663a9f1dda799"
       },
     "socialProfileData": "profile.aboutMe",
    "emptyMeansNull": false,
    "ignoreUpdate": false,
     "placeholder": {
          "key": "3d43b06fe00fa7cdc32e45ecc8399239"
       },
     "forms": [
          "traditionalRegistrationForm"
     ]
 }'