is cast() case sensitive ?

Hello,

When I'm trying to cast JSON to CDT it populates data from that response to cdt object only of field names are exactly same in both json and CDT. e.g.

if json response is:

{

  "firstName" : "Abc",

  "LastName": "Xyz"

}

and CDT is having two fields

  • firstName
  • LASTNAME

after cast to the cdt it populates only "Abc"

is there any way to ignore case sensitivity ?

  Discussion posts and replies are publicly visible

Parents
  • Cast() IS Case Sensitive:

    load(
      local!case: {
        title: "Mr.",
        DESCRIPTION: "Example"
      },
      fn!cast(
        'type!{urn:com:appian:types:SJB}SJB_CASE',
        local!case
      )
      
    )

    The CDT used in the above example has all of its attributes (other than its Primary Key) in lower-case and the output is as follows:

    SJB_CASE
        CaseId: null (Number (Integer))
        title: "Mr."
        description: null (Text)
        owner: null (Text)
        status: null (Text)
        startDate: null (Date)
        endDate: null (Date)

    As you can see, 'title' is copied across, but 'DESCRIPTION' is not.

    I do not know if a way of accessing the individual attributes and applying any function to change the case of any attribute. As far as I know your only option is to hand-cast the data:

    load(
      local!case: {
        title: "Mr.",
        DESCRIPTION: "Example"
      },
      local!castCase: 'type!{urn:com:appian:types:SJB}SJB_CASE'(
        title: local!case.title,
        description: local!case.DESCRIPTION
      ),
      local!castCase
      
    )

Reply
  • Cast() IS Case Sensitive:

    load(
      local!case: {
        title: "Mr.",
        DESCRIPTION: "Example"
      },
      fn!cast(
        'type!{urn:com:appian:types:SJB}SJB_CASE',
        local!case
      )
      
    )

    The CDT used in the above example has all of its attributes (other than its Primary Key) in lower-case and the output is as follows:

    SJB_CASE
        CaseId: null (Number (Integer))
        title: "Mr."
        description: null (Text)
        owner: null (Text)
        status: null (Text)
        startDate: null (Date)
        endDate: null (Date)

    As you can see, 'title' is copied across, but 'DESCRIPTION' is not.

    I do not know if a way of accessing the individual attributes and applying any function to change the case of any attribute. As far as I know your only option is to hand-cast the data:

    load(
      local!case: {
        title: "Mr.",
        DESCRIPTION: "Example"
      },
      local!castCase: 'type!{urn:com:appian:types:SJB}SJB_CASE'(
        title: local!case.title,
        description: local!case.DESCRIPTION
      ),
      local!castCase
      
    )

Children
No Data