Wiki

Scale Your Enterprise

User Tools

Site Tools


bw:using_variables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bw:using_variables [2019/10/23 12:04]
akoehler [Using Variables]
bw:using_variables [2019/10/23 14:46] (current)
Line 62: Line 62:
 A common use of this functionality is to maintain a counter to control processing or document processing. The calculation will typically be placed inside of a loop construct. A common use of this functionality is to maintain a counter to control processing or document processing. The calculation will typically be placed inside of a loop construct.
  
 +====Example 3=====
 Following is a simple example of how a “counter” calculation is defined. In this case we want to know how many records were passed into a loop from a SQLCommand step. for this example we will use a simple statement. Following is a simple example of how a “counter” calculation is defined. In this case we want to know how many records were passed into a loop from a SQLCommand step. for this example we will use a simple statement.
  
Line 135: Line 136:
  
 <WRAP left round tip> <WRAP left round tip>
-When variables are used, they have a very specific name structure, as shown in the “TimeStamp” example above. While it is possible to enter the variable name manually, this approach is not recommended.+When variables are used, they have a very specific name structure, as shown in the **//[[bw:using_variables#Special Note for Step Variables and Loops|Using Variables with loops code snippet above]]//**. While it is possible to enter the variable name manually, this approach is not recommended. If this approach is taken make sure that the syntax of the variable is the same as it is in the step, this includes capitalization.
  
 </WRAP> </WRAP>
Line 145: Line 146:
 ===== User Variable Example ===== ===== User Variable Example =====
  
-In the step marked “3” in the illustration above, a SQL statement is being used to report information from the database. We want to limit the data based on a certain value. In this example, a value from the “Variables” step is used.+In a Bizweaver workflow a user can reference variables that are initiated earlier in the workflow using the variables tool.In this example a SQL statement is being used to pull information from the database. We want to limit the data based on a certain value. In this example, a value from the “Variables” step is used.
  
-{{:bw:varimage7.png?576x231}}+The below workflow when processed will now only pull the CardType of "C" which is set in the "Variables_Init" step. 
 + 
 +{{ :bw:uservariablesexamplewf.png?nolink |}} 
 + 
 +In the variables tool there is a **User Defined Variable ** of "UserVariable1" 
 + 
 +{{ :bw:variablestoolscreen.png?569x110 |}} 
 + 
 +In the SQL tool step you can reference the **User Defined Variable** of "UserVariable1" by pressing [F4] in the SQL tool and navigating to the Variables option in the left menu and selecting the correct variable from the list of variables on the right menu. 
 + 
 +{{  :bw:varimage7.png?576x231  }}
  
 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.”
  
-{{:bw:varimage8.png?569x110}}+{{  :bw:varimage8.png?569x110  }}
  
 Since the variable value ‘C’ is a string (text), the variable name must be enclosed in single quotes as required by SQL. Since the variable value ‘C’ is a string (text), the variable name must be enclosed in single quotes as required by SQL.
Line 157: Line 168:
 ===== Step Variable Example ===== ===== Step Variable Example =====
  
-In the step marked “4” in the illustration above we are writing the output of the SQL step to a file.+In this example we are writing the output of the SQL step to a file. 
 + 
 +Below is the workflow we are using for the example. 
 + 
 +{{ :bw:stepvariablesworkflow.png?nolink |}} 
 + 
 +Note the fields in the SQL statement that will be referenced later. 
 + 
 +{{ :bw:stepvariablessql.png?482x384 |}}
  
-{{:bw:varimage9.png?482x384}}+Next when going to the file writer step you will press [F4] and select the variables from the SQL step.
  
-In this step, we make use of both Step and User variable type.+{{  :bw:varimage11.png?483x298  }}
  
-To make the file name unique each time it is created, we use the “time stamp” user variable created by the VBScript step. As noted earlier, we can use either the output name from the VBScript step, or the value created in the Variables step. For this example, the value from the VBScript step is used.+You can see each step variable in the "Body" section of the FileWriter Tool.
  
-{{:bw:varimage10.png?479x232}}+{{  :bw:varimage9.png?482x384  }}
  
-C:\Shared\Bizweaver\DataOut\Filewriter_VariablesTest_WorkFlow(VBScript).Get(TimeValue).txt 
  
-The values in the body section of the file (the actual data records) are step variables that come from the previous SQL Command step (3). 
  
-{{:bw:varimage11.png?483x298}} 
  
bw/using_variables.1571846686.txt.gz · Last modified: 2019/10/23 12:04 by akoehler