Skip to main content
November 30, 2021
Question

how to update list of instance cdt values based on condition without foreach() function

  • November 30, 2021
  • 7 replies
  • 0 views

Hi ,

I want to update the local variable of the type List of Cdt based on a condition. For eg.

myCDT:{{name:"Albert",age:30,Dept:'Sales',Sal:10000},{name:"Beth",age:28,Dept:'HR',Sal:2000},{name:"Cindy",age:35,Dept:'Finance',Sal:2000},.................}

Dept:{"HR","Sales"}

I wanted to update the Sal of myCDT list found in the Dept variable.

 

I know we can do it with foreach() function, but I have to map each field in the CDT. I have around 50 fields in my actual  CDT  

Is there another way to implement this ? Please suggest.

Thanks in advance.

 

    7 replies

    November 30, 2021

    Hi,

    You can try a!update() function
    https://docs.appian.com/suite/help/21.4/fnc_array_a_update.html

    Thanks,

    Farnaz

    November 30, 2021

    can you please provide an example?

    stefanhelzle0001
    Brainy
    November 30, 2021

    Would you please check the documentation before asking for examples.

    docs.appian.com/.../fnc_array_a_update.html