action:Set_Variable_to_Text
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| action:Set_Variable_to_Text [2017/07/15 15:50] – Fix error in dynamic variable per @peternlewis JMichaelTX | action:Set_Variable_to_Text [2023/09/15 09:44] (current) – peternlewis | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| The Set Variable to Text action allows you to set a selected variable to plain text, by either typing in the text box, or selecting a [[: | The Set Variable to Text action allows you to set a selected variable to plain text, by either typing in the text box, or selecting a [[: | ||
| + | |||
| + | Alternatively (v9.0+), you can Prepend the text to the variable, or Append the text to the variable by selecting from the action (gear) ⚙ menu. | ||
| {{: | {{: | ||
| - | --- | + | You can (v11.0+) set a specific array entry within the action. You can delete the entry by setting it to `%Delete%`. |
| ===== Examples ===== | ===== Examples ===== | ||
| + | |||
| ==== Set To Text You Type ==== | ==== Set To Text You Type ==== | ||
| Line 23: | Line 26: | ||
| ==== Combine Multiple Variables and Text ==== | ==== Combine Multiple Variables and Text ==== | ||
| + | |||
| There is no need to use any operators when combining text with multiple variables or other tokens. | There is no need to use any operators when combining text with multiple variables or other tokens. | ||
| {{: | {{: | ||
| - | --- | + | ==== Append to Variable ==== |
| + | |||
| + | You can append directly to a variable with the //Append// variant of the action: | ||
| + | |||
| + | {{append-variable-with-text.png? | ||
| + | |||
| + | or equivalently using text tokens to expand the variable: | ||
| + | |||
| + | {{set-append-variable-with-text.png? | ||
| + | |||
| + | ==== Set Second Line of Variable ==== | ||
| + | |||
| + | You can specify an array entry of the variable to set. By default, entries are comma separated, but you can specify an specific separator after the closing square bracket (`]`), | ||
| + | |||
| + | {{ set-second-line-of-variable-example.png? | ||
| ===== Setup ===== | ===== Setup ===== | ||
| Line 59: | Line 77: | ||
| **This requires two steps (two Actions):** | **This requires two steps (two Actions):** | ||
| - | | + | |
| + | {{: | ||
| + | |||
| + | **The Steps Are** | ||
| + | * **STEP 1.**\\ | ||
| * In the text area of the Action, enter a special form of the Token entity, where you will embed another Variable token, and optionally text. | * In the text area of the Action, enter a special form of the Token entity, where you will embed another Variable token, and optionally text. | ||
| * For example: `%%Variable%%myVar%Variable%myVarNum%%%` | * For example: `%%Variable%%myVar%Variable%myVarNum%%%` | ||
| * Note the use of two percent symbols (`%%`) in places where you want the result to be one `%`. | * Note the use of two percent symbols (`%%`) in places where you want the result to be one `%`. | ||
| - | * Here is how this text will be processed when the Action executes: < | + | * Here is how this text will be processed when the Action executes:\\ .< |
| %%Variable%%myVar%Variable%myVarNum%%% | %%Variable%%myVar%Variable%myVarNum%%% | ||
| Line 77: | Line 99: | ||
| %Variable%myVar2% | %Variable%myVar2% | ||
| </ | </ | ||
| - | * This is the variable we want to get the results of, so we will need another Action to get it. | + | * This is the variable we want to get the results of, so we will need another Action to get it.\\ |
| - | | + | |
| - | + | ||
| - | {{: | + | |
| - | + | ||
| - | --- | + | |
| ==== Dynamic Determination in Variable Name Block ==== | ==== Dynamic Determination in Variable Name Block ==== | ||
| + | |||
| Since the Variable Name block of the //Set Variable to Text// Action accepts tokens, we can just use it directly if we just need to concatenate two more more Variables, with optional text. | Since the Variable Name block of the //Set Variable to Text// Action accepts tokens, we can just use it directly if we just need to concatenate two more more Variables, with optional text. | ||
| * For example: `%Variable%myPrefix%%Variable%myFieldName%` | * For example: `%Variable%myPrefix%%Variable%myFieldName%` | ||
| Line 94: | Line 113: | ||
| ===== See Also ===== | ===== See Also ===== | ||
| - | ---- | + | ==== Actions |
| - | + | ||
| - | === Actions === | + | |
| + | * Prepend Text to Variable | ||
| + | * Set Variable to Text | ||
| + | * Append Variable with Text | ||
| * [[action: | * [[action: | ||
| * [[action: | * [[action: | ||
| Line 103: | Line 123: | ||
| * [[: | * [[: | ||
| - | ---- | ||
| ==== Forum ==== | ==== Forum ==== | ||
action/Set_Variable_to_Text.1500133813.txt.gz · Last modified: by JMichaelTX
