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"
    )

  • 0
    Certified Lead Developer
    in reply to Chris

    Hate to say it, because it's such anathema to myself and Mike Schmidt, as we've had many discussions on the subject before, but if all else fails you could see how the index() function behaves getting your property.

    BTW, SUPER EXCITED to see someone on the forum actually starting with property() to get a property!  But if it has a failing, then I suppose I can extend more grace to all who use index() for everything.

Reply
  • 0
    Certified Lead Developer
    in reply to Chris

    Hate to say it, because it's such anathema to myself and Mike Schmidt, as we've had many discussions on the subject before, but if all else fails you could see how the index() function behaves getting your property.

    BTW, SUPER EXCITED to see someone on the forum actually starting with property() to get a property!  But if it has a failing, then I suppose I can extend more grace to all who use index() for everything.

Children