{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Journeys","product":"Identity Management","type":"markdown"},"seo":{"title":"Expressions: Object fields and array values","description":"Everything about Mosaic Journeys, SDKs, and APIs","siteUrl":"https://developer.transmitsecurity.com/","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"expressions-object-fields-and-array-values","__idx":0},"children":["Expressions: Object fields and array values"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This describes how to access object fields and array items."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"qualification-expressions","__idx":1},"children":["Qualification expressions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Expressions may refer to a specific value within an object using a ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["qualification expression"]},". A qualification expression denotes the object to search a key in, and the key name. A qualification expression has two possible forms—",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["dot qualification"]}," and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["subscript qualification"]},". For each of these forms, an ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["optional qualification"]}," variant is also available."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"dot-qualifications","__idx":2},"children":["Dot qualifications"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The dot qualification is an expression of the form:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"object.qualification \n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["object"]}," is an expression which results in a value of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]},", and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["qualification"]}," is the name of a key contained in the object if the key is a valid identifier (i.e., starts with a letter and consists only of letters, numbers and underscore). For example, the expression: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"firstItem\" : 3, \"secondItem\": 4}.secondItem"]}," will return the value 4."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"subscript-qualifications","__idx":3},"children":["Subscript qualifications"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The subscript qualification is an expression of the form:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"object[qualification]\n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["object"]}," is an expression which results in a value of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]},", and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["qualification"]}," is an expression that results in a value of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}," (or a type that can be coerced to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]},")—identifying the key to look up in ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["object"]},". For example, the expression ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"firstItem\" : 3, \"secondItem\": 4}[\"first\"+\"Item\"]"]}," returns the value 3."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-qualifications","__idx":4},"children":["Optional qualifications"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A qualification expression that refers to a key that doesn't exist in the object in runtime will return a result of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},". A qualification expression that attempts to search a key in a value that is not an object will result in a runtime error."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The optional dot qualification is an expression of the form below. Its semantics are identical to the dot qualification expression except that an attempt to qualify a null value will return a result of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"object?.qualification \n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The optional subscript qualification is an expression of the form below. Its semantics are identical to the subscript qualification expression except that an attempt to qualify a null value will return a result of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"object?[qualification]\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"indexing-expressions","__idx":5},"children":["Indexing expressions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Expressions may refer to a specific value within an array using an ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["indexing expression"]},". An indexing expression denotes the array to retrieve an item from, and the index of the item to retrieve."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Indexing expressions take the form:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"array[qualification]\n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["where ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["array"]}," is an expression which results in a value of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]},", and ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["qualification"]}," is an expression that results in a value of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]}," (or a type that can be coerced to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["number"]},")— identifying the index of the item to retrieve from ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["array"]},". The index of the first item in an array is 0. For example, the expression:",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[3, 4, 5][1+1]"]}," will return the value 5."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An indexing expression that refers to an index beyond the range that exists in the array in runtime will return a result of type ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]},". An indexing expression that attempts to retrieve an item from a value that is not an array will result in a runtime error."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"compose-expressions","__idx":6},"children":["Compose expressions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Like any other type of expression, field access and array indexing can be composed and chained to navigate through arbitrarily complex data structures. For example, the following expression:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"js","header":{"controls":{"copy":{}}},"source":"rootObject.firstArray[2].anotherField\n","lang":"js"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["would lookup variable ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["rootObject"]},", and search for a key named ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["firstArray"]}," within the returned object. In that array, the third element (with index 2) will be retrieved—expecting an object, and within that object the field ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["anotherField"]}," will be retrieved."]}]},"headings":[{"value":"Expressions: Object fields and array values","id":"expressions-object-fields-and-array-values","depth":1},{"value":"Qualification expressions","id":"qualification-expressions","depth":2},{"value":"Dot qualifications","id":"dot-qualifications","depth":3},{"value":"Subscript qualifications","id":"subscript-qualifications","depth":3},{"value":"Optional qualifications","id":"optional-qualifications","depth":3},{"value":"Indexing expressions","id":"indexing-expressions","depth":2},{"value":"Compose expressions","id":"compose-expressions","depth":2}],"frontmatter":{"showNextButton":true,"showPrevButton":true,"seo":{"title":"Expressions: Object fields and array values"}},"lastModified":"2025-11-18T16:48:04.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/orchestration/getting-started/expressions/object-array-items","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}