Skip to main content
ashutoshg0001
September 17, 2021
Question

How can i Update 5 rows in CDT at one time?

  • September 17, 2021
  • 5 replies
  • 0 views

Hi,

       I have a cdt in which a column is SNO as

         SNO   name

           1       abc

           2       def

           3       ghi

           4       jkl

 I want to update only SNO as 2,3,4,5  and it should be 3,4,5,6 . I don't want to update 1 . Which logic i should write?

    5 replies

    richardm900458
    September 17, 2021

    Do you want to do it during/after loading by a query rule, right before storing in a smartservice, in an interface via button action or Link? 

    ashutoshg0001
    September 17, 2021

    In an interface via button action

    richardm900458
    September 17, 2021

    this should do the trick

    a!forEach(
        items: {yourCDTarray},
        expression:if(
            fv!Index>1,
            a!update(
                data:fv!item,
                index:"sno",
                value:fv!index+1
            ),
            {}
        )
    )