Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
{
    "Descriptive": {
       "Title": "#{R('Descriptive.Title').toUpperCase()}",
       "Description": "#{R('Descriptive.Title') + ': ' + R('Dynamic.CustomDescription')}",
       "Keywords": {"Keyword": "#{{R('Dynamic.CustomTag')}}"}
    },
    "Dynamic": {
        "Orientation": "#{R('Technical.Width') > R('Technical.Height') ? 'Horizontal' : 'Vertical'}",
        "AdditionalInformation": "My custom field"
    }
}

...

Output after evaluating the expression

Conversion into JSON

String

JSON string

Boolean

JSON boolean

Long

JSON number

List<String>

JSON array

Map<String>

JSON object

Map<String,List<String>>

JSON object containing JSON arrays

Notice how the string "#{{R('Dynamic.CustomTag')}}" is evaluated into an array ["My custom tag"]. The end result is a valid metadata sidecar for “Keywords” namely "Keywords": {"Keyword": ["My custom tag"]} whereas before evaluating the expression "Keywords": {"Keyword": "#{...}"} is not a strictly valid metadata sidecar because the value of "Keyword" must be an array and not a string.

...