Property Function - default value return Null

Certified Lead Developer

i am trying index the property "ISOCountryCodeOfIssue", if it is not available in the dictionary (data). We need to default value output.

We run the expression , it return back null instead of "BCD"

property(
{
/*ISOCountryCodeOfIssue: "ABC",*/
expiryDate: "10/20/2016",
issueDate: "10/20/2011",
documentId: "XR58",
documentType: "PASSPORT",
issuingAuthority: "EN"
}
,"ISOCountryCodeOfIssue","BCD")
Not sure what am i exactly missing here

  Discussion posts and replies are publicly visible

Parents
  • Strangely enough I can't say I've run into this "feature" with property() over a dictionary object..  I receive the same result of null vs "BCD" in my environment however.  Barring the unexpected functionality there, a few options are, use a!map() if you are on a recent version of Appian, or convert to a datasubset:

    property(
      a!map(
        /*ISOCountryCodeOfIssue: "ABC",*/
        expiryDate: "10/20/2016",
        issueDate: "10/20/2011",
        documentId: "XR58",
        documentType: "PASSPORT",
        issuingAuthority: "EN"
      ),
      "ISOCountryCodeOfIssue",
      "BCD"
    )

    property(
      todatasubset(
        {
          /*ISOCountryCodeOfIssue: "ABC",*/
          expiryDate: "10/20/2016",
          issueDate: "10/20/2011",
          documentId: "XR58",
          documentType: "PASSPORT",
          issuingAuthority: "EN"
        },
        a!pagingInfo(1,1)
      ),
      "ISOCountryCodeOfIssue",
      "BCD"
    )

Reply
  • Strangely enough I can't say I've run into this "feature" with property() over a dictionary object..  I receive the same result of null vs "BCD" in my environment however.  Barring the unexpected functionality there, a few options are, use a!map() if you are on a recent version of Appian, or convert to a datasubset:

    property(
      a!map(
        /*ISOCountryCodeOfIssue: "ABC",*/
        expiryDate: "10/20/2016",
        issueDate: "10/20/2011",
        documentId: "XR58",
        documentType: "PASSPORT",
        issuingAuthority: "EN"
      ),
      "ISOCountryCodeOfIssue",
      "BCD"
    )

    property(
      todatasubset(
        {
          /*ISOCountryCodeOfIssue: "ABC",*/
          expiryDate: "10/20/2016",
          issueDate: "10/20/2011",
          documentId: "XR58",
          documentType: "PASSPORT",
          issuingAuthority: "EN"
        },
        a!pagingInfo(1,1)
      ),
      "ISOCountryCodeOfIssue",
      "BCD"
    )

Children