Skip to main content
ashutoshg0001
Known Participant
Sep 17, 2021 8:47 AM UTC
Question

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

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
    Inspiring
    Sep 17, 2021 8:55 AM UTC

    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
    Known Participant
    Sep 17, 2021 8:58 AM UTC

    In an interface via button action

    richardm900458
    Inspiring
    Sep 17, 2021 9:01 AM UTC

    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
            ),
            {}
        )
    )