Rule to calculate length of String

rule to calculate length of a string. if the length of string exceeds 50, then show the access text with (...more.) else returns the sring.

  Discussion posts and replies are publicly visible

Parents
  • Use this code....

    a!localVariables(
      
      local!text: " The local variable to use when evaluating the given expression. Use the 'local!' domain to define and reference individual variables. By default, a local variable will automatically update when any variables it references are changed. To change the way variables are updated, use the a!refreshVariable() function. Variables can be refreshed under the following conditions: after each reevaluation, periodically on an interval, or when other variables change.",
      
      local!result:if(
        condition: len(local!text)>50,
        valueIfTrue: concat({left(local!text, 50),  " (more...)"}),
        valueIfFalse: local!text
      ),
      
      local!result
      
    )

Reply
  • Use this code....

    a!localVariables(
      
      local!text: " The local variable to use when evaluating the given expression. Use the 'local!' domain to define and reference individual variables. By default, a local variable will automatically update when any variables it references are changed. To change the way variables are updated, use the a!refreshVariable() function. Variables can be refreshed under the following conditions: after each reevaluation, periodically on an interval, or when other variables change.",
      
      local!result:if(
        condition: len(local!text)>50,
        valueIfTrue: concat({left(local!text, 50),  " (more...)"}),
        valueIfFalse: local!text
      ),
      
      local!result
      
    )

Children
No Data