Appearance
Robodoc to Variable
This is a special task block that can use a RoboDoc to format data to then be placed into a variable.
If the input to the delay block is triggered the task block will read either the RoboDoc text or will load the RoboDoc text from the specified Robodoc. The task block will replace any variables referenced inside the Robodoc and place the resulting text into the specified variable.
Examples
Here is a simple example of a mission that uses a RoboDoc to variable task block.
Use Cases
The RoboDoc to variable task block has a lot of valuable use cases:
- Parsing JSON: If you have a JSON variable you can use the RoboDoc syntax to parse out a part of the JSON. For example, lets say that you have the following JSON object:
{
"first":"Eddie",
"last":"Murphy"
}and it is placed in a variable named "var1". You could use the following RoboDoc text to extract the first name.
The first name is {$var1->first}- You could also use this task block to build new variables. For example, you might have data in multiple variables within a mission that you want to combine in a new variable. Lets say we have the value "Eddie" in variable "var1" and "Murphy" in "var2" and we want to create a JSON object and put into "var3". You can create a RoboDoc text and place into the first configuration:
{
"first":"{$var1}",
"last":"{$var2}"
}We would then just set the last configuration input in the task block to "var3". The result will be the JSON used in the first example.
Copy / Settings / Docs
Each task block has three buttons named Copy, Settings, and Help.
- Copy: This will duplicate the task block with all the current settings.
- Settings: Settings will show a dialog that allows some added configuration for the block
- Note: This allows you to add a text note for the current block. This note will appear in the log file if the Block Loggin option is enabled.
- Transition Out Time: Each block can specify a delay in milliseconds that it will wait after an output trigger is activated. This feature is generally not used but is avilable for more granular flow control of the mission if needed.
- Block Logging: If this is enabled then the internal logging of the block is turned on and will be sent to the mission log. Each block has different amounts of internal logging which can make mission logs become large in some cases. Users generally do not enable this feature because of the limits to data storage.