Skip to main content
ankushs0002
December 11, 2024
Question

Related to function..

  • December 11, 2024
  • 7 replies
  • 0 views

I am just looking at this rule and find this unsupported function can anyone tell me that what is the behaviour of this function .

reduce(
update_unsupported(_,_,_),
{},
{}
)

what we can use instead of update_unsupported to remove (_,_,_)

7 replies

mikes0011
Brainy
December 11, 2024

We'd need more context - where was this found and what does it seem to be doing?  I haven't seen it myself, but there's a chance it could be a reference to a pre-publication version of something like a!update(), which was only released relatively recently (in the long run).  But without more context it's hard to say.

ankushs0002
December 11, 2024

I am trying to replace this function , Currently i am reducing and merging the dictionary data, so i just want to know what i can do better

reduce(
update_unsupported(_,_,_),
cast(
'type!{urn:com:appian:types}TSW_Resident',
rule!TSW_getResidentByYardiID("t0020328")
),
merge(
{
"ResidentYardiID",
"PropertyYardiID",
"Email",
"FirstName",
"HomeNumber",
"LastName",
"LeaseEndDate",
"LeaseStartDate",
"MobileNumber",
"OfficeNumber",
"Status",
"ReasonForMoveOut",
"MoveInDate",
"MoveOutDate",
"CreateDate",
"CreateUser",
"UpdateDate",
"UpdateUser",
},
{
"dd",
"dd",
"dd",
"dd",
"dd",
"ss",
"aa",
"fff",
"ff",
"ff",
"ff",
"ff",
"sss",
"ff",
now(),
null,
now(),
null
}
),
)

mikes0011
Brainy
December 11, 2024

BTW:

It seems at first glance whether this is doing similar to a!update or updateDictionary() and updating the fields named in the first array with the values in the final array.  I'm unclear why it's using reduce() unless that's somehow doing something more convoluted with the results of the query rule i.e. if it returns a list rather than a single value; i suppose maybe it's stepping through the list of keys one at a time and replacing the values one at a time, which of course with the modern a!update() function should be totally unnecessary as it handles a list of replacement property names followed by a list of replacement values, and handles all of that inherently.