Help Desk

Submit a ticket My Tickets
Welcome
Login

Dynamic Outputs

Dynamic Outputs are rules that create variables from Command outputs. The rules are configured to selectively extract a single value or a list of values by using an exact string match or regular expression (regex). These rules provide a powerful way to quickly and easily extract text that can be used in other areas of a OneCloud Chain. All output types are supported, and it is possible to add multiple Dynamic Output rules to a single Command.

Create a Basic Dynamic Output

To create a Dynamic Output, please follow these steps: 

  1. Add a Command such as List File Content that produces an output.
  2. Edit the Command and navigate to the Command Output tab (fourth tab with a lightning bolt).
  3. Set the Name of the variable.
  4. Select the Orginal output type (the list is based upon the output of that particular Command).
  5. If using Exact, enter the Start and End string to match as well as the option to Include start and Include end.
  6. If using Regular expression, then set the Match Text and Match Result.
  7. In both cases, optionally set the Lines to check. Separate with commas and specify ranges with a - (i.e. 1-10).
  8. Set if the desired result should be a Single value or Multiple values in the form of a JSON list. 
  9. For Exact match, optionally toggle Case sensitive and Trim matches to eliminate white space.

Add and Delete a Dynamic Output Rule

Add a Dynamic Output by selecting the blue button at the bottom of the interface and use the trash can icon to the right of the Orginal Output dropdown to remove a particular rule.

Pro Tip: Extracting values from a text file

If there is a file, such as a log file that contains values that need to be set as OneCloud variables, use the List File Content command and the Dynamic Outputs to get and set the variable value(s).

Test Dynamic Outputs

From within the Dynamic Outputs editor, the string matching rules can be tested to ensure that the text capture is configured correctly. In the following example, the following list of telephone numbers is tested with a regular express:

(381) 782-5259
(511) 545-6132
(220) 476-8339
(837) 516-4312

The following regular expression is used in the Match Text, which isolates and groups multiple digits between parathesis: 

\(([0-9]*)\)

The Match Results returns the value of the group.

$1

In the following example, notice that switching the Output type from Single to Multiple allows multiple values to be selected. 

Single versus Multiple Dynamic Outputs

Dynamic Command outputs can be set to be a single value or multiple values. If multiple is selected, an array list variable is created with a maximum of 1000 items. Dynamic Outputs that use multiple values can be useful with Command and Command group iterations.


What's Next? 

Learn about Variable Transformation.

O
OneCloud is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.