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