Skip to main content
michaelk1933
June 27, 2023
Question

Use of { & } to delimit functions in an object

  • June 27, 2023
  • 4 replies
  • 0 views

I'm in a discussion with a colleague on whether its legal to use {} to delimit nested variables in an if statement.

I.e.:

if(
{                 this

and(or(
isnull(local!shortRecon.recordsRequested),
isnull(local!shortRecon.reconsiderationRequested)
),
local!claim.claimStatusId<>cons!OWB_DBID_LOOKUP_ID_CLAIM_STATUS_FINAL_ORDER_ISSUED
)
},                 and this


{                 this

if(isnull(local!shortRecon.recordsRequested),a!save(ri!recon.recordsRequested,false),{}),
if(isnull(local!shortRecon.reconsiderationRequested),a!save(ri!recon.reconsiderationRequested,false),{})

},                 and this
{}
)

Is this acceptable use?

    4 replies

    stefanhelzle0001
    Brainy
    June 27, 2023

    As curly brackets indicate a list in Appian, I would not do that. There are some ugly edge cases, almost impossible to debug.

    mikes0011
    Brainy
    June 27, 2023

    I'm not even sure what you mean by "nested variables" in the context of the code sample you've posted here.  Any chance you could post a cleaner example, with indentation, and in a Code Box where it'll maintain some amount of readability?  If any of the wording ("and this" etc) is meant as annotative, then put it in /* comment blocks */ for clarity.

    I will say, up front, that you can nest and() and or() conditional logic to almost any level (limited only by a viewer's ability to make sense of whatever spaghetti code we end up creating), which never requires "{}" - since as Stefan correctly noted, these specifically incidate arrays to Appian.

    The Expression Guru
    michaelk1933
    June 27, 2023

    Mea culpa !

    mikes0011
    Brainy
    June 27, 2023
    Mea culpa !

    No need for apologies [emoticon:c4563cd7d5574777a71c318021cbbcc8]  We merely want to coax out of you what you're actually intending to do, hopefully to provide clarification as far as creating Appian code that's more graceful and/or efficient.

    The Expression Guru