Hi,
I've found in an existing code application this function called with 5 parameters (please see below).
But the Appian documentation says that the Property function must have 3 parameters only. This code works, but throw an error in Design mode (exactly like the "if" function which can take more than 3 parameters).
How would you replace this code ? with additional if conditions ?
property( local!availabilityResponse, "body", "resources", "type", null)Regards
Discussion posts and replies are publicly visible
Following code allows you to drill down into a nested data structure. I called it deepIndex(). The rule inputs are all of the "any" type.
Use it like
rule!deepIndex( data: local!availabilityResponse, path: {"body", "resources", "type"}, default: null )
if( isnull(ri!path), ri!data, reduce( index(_,_,ri!default), ri!data, ri!path ) )
Thanks a lot Stefan, but why the Property(5 params) works in code, but not in Design mode ?
AFAIK this is a hidden and not supported behavior.
ok, I understand. thank you
I would have the same question about the "index" function please (4 parameters found in place of 3) :
index( ri!myRI, "field1", "field2", tointeger({}) ),
how you would code it ?
For which purpose? Drill down or fetch two fields on the same level? For drill down, see my code snippets above. For fetching two fields, this would be two index() calls.
Yes Stefan, it is for two fields... and I use index(index(...)) to reproduce the case... Sorry I have made the test meanwhile and should not post my message