is there any way of updating a variable just if a reference varible change and is not null ?

Certified Associate Developer

foreach(items:local:lines,expresion:
local!searchsection:
      if(
        or(lower(left(trim(fv!item),7 ) ) = "section",
        regexmatch("\d{1,2}[.]\d{1,2}",
        left(trim(fv!item),5 )

        ))


      ,

        "Section: "& cleanwith(left(trim(fv!item),12 ), "1234567890.")
      
      ,{})

      ,
      local!section:a!refreshVariable(


        value:  local!searchsection

        ,refreshOnReferencedVarChange:
        if(
          rule!NPA_isEmpty(local!searchsection),
          false(),
          true()
        )
      ),
       local!section
      )

I'm trying to modify  the second variable just if the first variable that i  have is not null but  if it is  null i need to  keep the last value the variable had

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    let me explain a little bit better i'm looping into some  lines   each of those  lines are inside a section but a section   could start in any line  and i want  to know  which line is part of which   section  when i find a section number i want  to be able to keep it  until we get to capture the next section number.

  • 0
    Certified Lead Developer
    in reply to felixr

    In Appian Expressions, variable values cannot be changed once assigned. In interfaces, this is possible only on user interaction.

    Is this only about displaying these sections dynamically? Then, you could show the section header only if you found a section in that line.

  • +1
    Certified Associate Developer
    in reply to Stefan Helzle

    Hi  thanks for helping me today i found a work around    to do this   with   a process model

    just making another list    and looping  this way cause if i try to loop  by the  config in multiple instances  of this node the variable don't update   correctly.  but  looping with a xor   till we get to the limit  we can update the  variable each time with no problem.

    it  was about  generating a file searching for some  key phrases and  displaying  in which section it was found.

Reply
  • +1
    Certified Associate Developer
    in reply to Stefan Helzle

    Hi  thanks for helping me today i found a work around    to do this   with   a process model

    just making another list    and looping  this way cause if i try to loop  by the  config in multiple instances  of this node the variable don't update   correctly.  but  looping with a xor   till we get to the limit  we can update the  variable each time with no problem.

    it  was about  generating a file searching for some  key phrases and  displaying  in which section it was found.

Children
No Data