Hear from Salesforce leaders on how to create and deploy Agentforce agents.
Contact Us 1-800-596-4880

objectFields

objectFields(t: Type): Array<Field>

Returns the array of fields from the given Object type. This function fails if the type is not an Object type.

Introduced in DataWeave version 2.3.0.

Parameters

Name Description

t

The function type.

Example

This example shows how objectFields behaves with different inputs.

Source

import * from dw::core::Types
ns ns0 http://acme.com
type ADictionary = {_ : String}
type ASchema = {ns0#name @(ns0#foo: String): {}}
type AUser = {name @(foo?: String,l: Number)?: String, lastName*: Number}
---
{
    a: objectFields(ADictionary),
    b: objectFields(ASchema),
    c: objectFields(Object),
    d: objectFields(AUser)
}
DataWeave

Output