This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
bw2:using_variables [2021/02/10 17:34] akoehler [What are Bizweaver Variables?] |
bw2:using_variables [2023/12/19 09:02] (current) wgates |
||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ====== What are Bizweaver Variables? ====== | ====== What are Bizweaver Variables? ====== | ||
| - | **“Variables”** are data values | + | **“Variables”** are data values held in memory during the execution of a workflow. There are two types of variables in Bizweaver: **User Variables** and **Step Variables**. |
| **“[[bw2: | **“[[bw2: | ||
| Line 15: | Line 15: | ||
| ====== Variables Tool ====== | ====== Variables Tool ====== | ||
| - | The **Variables** tool can be used in two ways. First, it can establish constant/ | + | The **Variables** tool can establish constant/ |
| {{ : | {{ : | ||
| Line 44: | Line 44: | ||
| ====Example 2===== | ====Example 2===== | ||
| - | In this example, variables are defined for login credentials used at various points | + | In this example, variables are defined for login credentials used at various points |
| * In this case, the __values__ are static. | * In this case, the __values__ are static. | ||
| Line 63: | Line 63: | ||
| ====Example 3===== | ====Example 3===== | ||
| - | Following is a simple example of how a “counter” calculation is defined. | + | Following is a simple example of how a “counter” calculation is defined. |
| {{ : | {{ : | ||
| Line 71: | Line 71: | ||
| {{ : | {{ : | ||
| - | The “SQLCommand_getData” step reads a list of data records. This list feeds into a loop. | + | The “SQLCommand” step reads a list of data records. This list feeds into a loop. |
| < | < | ||
| - | Select | + | SELECT |
| - | (recordNumber) -- This will be a record number from your table that you are using | + | [recordNumber] -- This will be a record number from your table that you are using |
| - | From | + | FROM |
| - | | + | |
| </ | </ | ||
| Line 92: | Line 92: | ||
| {{ : | {{ : | ||
| - | This type of processing could be used in conjunction with a **// | ||
| ====== Step Variables ====== | ====== Step Variables ====== | ||
| Line 104: | Line 103: | ||
| The step named “SQL Command_getData” uses the SQL statement: | The step named “SQL Command_getData” uses the SQL statement: | ||
| - | <code sql>select | + | <code sql>SELECT |
| - | t0.CardCode, | + | CardName, |
| - | from OCRD t0 | + | CardType |
| + | FROM OCRD | ||
| </ | </ | ||
| This produces a list of records that feeds into the loop “Loop_ProcessRecords.” The step variable created for “CardCode” is: | This produces a list of records that feeds into the loop “Loop_ProcessRecords.” The step variable created for “CardCode” is: | ||
| - | < | + | < |
| This step variable is used in the FileWriter_VariableTest step. | This step variable is used in the FileWriter_VariableTest step. | ||
| Line 117: | Line 117: | ||
| The list contains the values C1, C2, and C3. | The list contains the values C1, C2, and C3. | ||
| - | The first time the file writer | + | The first time the file writer sees the step variable, the value will be the first record in the list or C1. Then, when the end of the loop processing is reached, the next record from the list is read. |
| When the file writer step sees the same step variable, the next record will be returned from the SQL select statement or C2 received from the loop processing. This cycle continues for each record read into the loop processing. | When the file writer step sees the same step variable, the next record will be returned from the SQL select statement or C2 received from the loop processing. This cycle continues for each record read into the loop processing. | ||
| Line 125: | Line 125: | ||
| The following image illustrates how variables are selected. This process is used in all instances where some variable needs to be referenced. The list of available workflow steps will get larger as you progress through additional steps in the workflow. | The following image illustrates how variables are selected. This process is used in all instances where some variable needs to be referenced. The list of available workflow steps will get larger as you progress through additional steps in the workflow. | ||
| - | {{ :bw2:bizweavervartool10.png |}} | + | {{ :bw2:bizweavervarmanager1.png |}} |
| - Position the cursor in the field where the variable is needed. | - Position the cursor in the field where the variable is needed. | ||
| - Press **F4** | - Press **F4** | ||
| - | - The ‘Choose Variable” | + | - The ‘Choose Variable” |
| - | - Workflow steps before the current one are listed in the left-hand panel. | + | - Workflow steps before the current one are listed in the right-hand panel. |
| - Click on the appropriate step name. | - Click on the appropriate step name. | ||
| - | - Available variables for the selected step are displayed | + | - Available variables for the selected step are expanded for the step in the right-hand panel. |
| - | - Select the desired variable and click [OK] to select the value into the target field. | + | - Select the desired variable and double |
| <WRAP left round tip> | <WRAP left round tip> | ||
| - | When variables are used, they have a very specific | + | When variables are used, they have a particular |
| </ | </ | ||
| Line 146: | Line 146: | ||
| ===== User Variable Example ===== | ===== User Variable Example ===== | ||
| - | In a Bizweaver workflow, a user can reference variables initiated earlier in the workflow using the variables | + | In a Bizweaver workflow, a user can reference variables initiated earlier in the workflow using the variables |
| When processed, the below workflow will only pull the CardType of " | When processed, the below workflow will only pull the CardType of " | ||
| Line 156: | Line 156: | ||
| {{ : | {{ : | ||
| - | In the SQL tool step, you can reference the **User-Defined Variable** of " | + | In the SQL tool step, you can reference the **User-Defined Variable** of " |
| - | {{ :bw2:bizweavervartool13.png |}} | + | {{ :bw2:bizweavervarmanager2.png |}} |
| So, the SQL statement now uses the value ‘C’ in the variable “UserVariable1.” | So, the SQL statement now uses the value ‘C’ in the variable “UserVariable1.” | ||
| Line 178: | Line 178: | ||
| {{ : | {{ : | ||
| - | Next, when going to the file writer step, you will press [F4] and select the SQL step variables. | + | Next, you will press [F4] and select the SQL step variables |
| - | {{ :bw2:bizweavervartool15.png |}} | + | {{ :bw2:bizweavervarmanager3.png |}} |
| You can see each step variable in the " | You can see each step variable in the " | ||
| Line 186: | Line 186: | ||
| {{ : | {{ : | ||
| + | ======String Manipulation====== | ||
| + | |||
| + | Starting in Bizweaver 2.7.2, the functionality to modify variables was introduced. This allows a user to manipulate all variables that are inserted in a specific step. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | * **Escape:** Selecting this checkbox will enable or disable the escaping functionality. | ||
| + | * Only one of these can be selected at once, and they only apply in the step in which they are enabled. | ||
| + | * **JSON:** Selecting this will escape reserved characters for a JSON file. See the table below for more information. | ||
| + | * **XML:** Selecting this will escape any reserved characters for an XML file. See the table below for more information. | ||
| + | * **SQL:** Selecting this will escape reserved characters for SQL Server see table below for more information | ||
| + | * **Replace empty values with NULL:** This will take any empty strings or blanks ex '' | ||
| + | * This works independently of the Escape functions. | ||
| + | |||
| + | ^**JSON Reserved Character** | ||
| + | |Backspace | ||
| + | |Form feed | ||
| + | |Newline | ||
| + | |Carriage return | ||
| + | |Tab |A tab in a string | ||
| + | |" | ||
| + | |\ |A backslash | ||
| + | |||
| + | ^**XML Reserved Character** | ||
| + | |< |Less than sign |<| | ||
| + | |> | ||
| + | |& | ||
| + | |" | ||
| + | |' | ||
| + | |||
| + | ^**SQL Reserved Character** | ||
| + | |' | ||