Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

GlobalCapture can perform addition and subtraction functions on numeric process fields.  This functionality can be useful when working though lists or tables of data.  When using notation, the data type of the process fields in the notation will impact the entire expressionIf for example you use a notation that includes both numeric and character process fields, the entire expression will be treated as a numeric expression and math will be performed.

Consider the following expression:

{p_MVChar[p_CharIndex]}

This expression involves two process fields (MVChar and CharIndex).  MVChar is a multi-value field, which some might call an array.  The common method for accessing items in this type of list would be the reference a specific item in the list by providing its index in square brackets.  So in the example, CharIndex represents some numeric index value, and in this expression the value returned would be the value at CharIndex's position in the list.  If CharIndex's data type is numeric, which normally makes sense so it value might be incremented at a different step in the workflow, the entire expression is evaluated as a numeric.  This means any data in MVChar that is numeric, will be considered numeric a math may be performed.  If MVChar contains a SSN (111-11-1111), the inferred data type and it's preference to perform math will lead to undesirable results.

Solution

It's important to understand when and how GlobalCapture will perform math functions on data, and how data in a field will be processed to ensure expected results.

Solution

  The presence of a "+" or a "-" in the Value of a Set Process Field node will only operate as a mathematical function if the data type of the field is correct.  When using a character field, these characters will be treated as literal values versus an expression.

NOTE: When using notation, the data type of the process fields in the notation will impact the entire expression.  If for example you use a notation like 

Wiki Markup
{p_CharFieldName}

The way notations work, there is a hierarchy created with our datatypes. Date, Dec, Num, then Char. As soon as one of these type of fields is used, the Math Mode get changed and held at the highest tier. In this case Dan is using a numeric type as the index of a MV, so {p_MVChar[p_NumIndex]} That MVChar contains data such as "123-456". Because the math mode has been changed to numeric, it's going to try to do math with that output. So alternatively, Dan can set the {p_NumIndex} to a char then use that char as {p_MVChar[p_CharIndex]} and it should resolve the issue.

...

bgColor#fff

...

  This is true even when working with lists and counter fields to control elements in the list.  If you don't want math to be performed in expressions, be sure all data types in the expression are of type Character.  You may need to create a new process field of type Character and sets it value to the value of the current Numeric index value before the primary expression is evaluated.


Filter by label (Content by label)
showLabelsfalse
max5
spacesS9SKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("globalcapture","workflows") and type = "page" and space = "S9SKB"
labelsglobalcapture workflows

...

Page Properties
hiddentrue


Related issues