Writing File Using Agent
  • Updated on 27 Mar 2019
  • 2 minutes to read
  • Print
  • Dark
    Light

Writing File Using Agent

  • Print
  • Dark
    Light

This tutorial demonstrates how to Write a File to the Client machine using an Agent in Decisions .
To learn what an Agent is and how to set it up in Decisions please follow this document:
Setting Up an Agent

Example:
Begin in the Designer Folder with clicking Create Flow on Folder Actions Panel.

createflow.jpg

Name the Flow and select Create to proceed to the Flow designer.

savemain.jpg

In the Flow Designer add a Create File step from Integrations > All Integrations > File category.

CreateFile.jpg

In this example we are going to use a simple***txt file*** to write to the client machine using Agent
testFile.png

For data Input into the Create File step use the Constant Mapping Type*and drag and drop the *file into the Value box.
2018-01-11_092444-1024x775.png

For the file Name Input use Constant Mapping Type. In the Value field we provide full path where we want to create file on our Client machine and file Name.

2018-01-11_092730-1024x779.png

Next, connect the outcome from the Create File step to the End Step in theFlow.
Finally, in the Flow Settings change Behavior Type to Agent Flow. This completes the Flow . Now save the Flowand close Flow designer.
2018-01-11_093140-1024x632.png

Back in the designer Folder select Create Flow on Folder Actions Panel.

createflow.jpg

Then, Name the Flow and select Create to proceed to the Flow Designer.

savemain.jpg

In the Flow Designer we add GetAgentList step from Flows, Rules, Forms and Reports > Flows > Wizards > AgentFlowsAndRules category.
2018-01-11_093358-1024x768.png

Then, on the outcome from GetAgentList we add Run Agent Flow step from Flows, Rules, Forms and Reports > Flows > Advanced category.
2018-01-11_093501-1024x770.png

Next, we are going to set up Run Agent Flow step. In the Edit Step: Run Agent Flow and select Pick Or Create Flow from the editor.

2018-01-11_093559-1024x808.png

Next on the right side, pick the previously created flow. In this example select **Write File Flow ** and pick.

writeflowpick.jpg

Use Select Value Mapping Type for Agent Id Input. Navigate to and expand **Agent Sub Folders **and **GetAgentList step. Expand First **and then select FolderID.
2018-01-11_093729-1024x773.png

Next, we connect the outcome from Run Agent Flow to the End Step in our Flow . This completes our Main Flow . We can save the Flow and close Flow Designer.
2018-01-11_093830.png

Back in the Designer Folder we locate thumbnail for our Main Flow and click Action > Run Flow on the thumbnail’s menu.
2018-01-11_093904.png

Our Flow runs silently with no User Interactions . If we switch to our Client machine we should see our text file created in the location defined in Write File Flow.
2018-01-11_094148-1024x662.png

Was this article helpful?