how to implement the functionality that is on all the sites? up and down arrows

Certified Associate Developer

Hi community @Appian, 

I simply want to be able to implement this :

),
a!richTextIcon(
icon: "sort-up",
size: "MEDIUM",
link: a!dynamicLink(saveInto: a!save(index:fv!index-1)),
linkStyle :"STANDALONE"

)

this is what I have currently, 

any leads on how  I can accomplish this?

thanks,

  Discussion posts and replies are publicly visible

Parents
  • Hi there,
    You can achieve this using this simple trick.
    Let's assume that the variable holding data is local!data. Also this is the variable on which you are iterating the forEach loop.
    Now you can use this in you save into

    a!save(
       local!data,
       updatearray(
         local!data,
         {
           fv!index,
           fv!index-1
         },
         {
           local!data[fv!index-1],
           fv!item
         }
       )
     )

    This code will work for shifting a row up. Therefore use this on up arrow.
    Similarly for shifting down (Down arrow), replace the minus(-) operator with plus(+) operator and that would work.

    Extra : The icons shown in the picture are not rich text icons but iconIndicator used inside ImageField (DocumentImage) 

Reply
  • Hi there,
    You can achieve this using this simple trick.
    Let's assume that the variable holding data is local!data. Also this is the variable on which you are iterating the forEach loop.
    Now you can use this in you save into

    a!save(
       local!data,
       updatearray(
         local!data,
         {
           fv!index,
           fv!index-1
         },
         {
           local!data[fv!index-1],
           fv!item
         }
       )
     )

    This code will work for shifting a row up. Therefore use this on up arrow.
    Similarly for shifting down (Down arrow), replace the minus(-) operator with plus(+) operator and that would work.

    Extra : The icons shown in the picture are not rich text icons but iconIndicator used inside ImageField (DocumentImage) 

Children