Writing File Using Agent
- Updated on 27 Mar 2019
- 2 minutes to read
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
Begin in the Designer Folder with clicking Create Flow on Folder Actions Panel.
Name the Flow and select Create to proceed to the Flow designer.
In the Flow Designer add a Create File step from Integrations > All Integrations > File category.
In this example we are going to use a simple***txt file*** to write to the client machine using Agent
For data Input into the Create File step use the Constant Mapping Type*and drag and drop the *file into the Value box.
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.
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.
Back in the designer Folder select Create Flow on Folder Actions Panel.
Then, Name the Flow and select Create to proceed to the Flow Designer.
In the Flow Designer we add GetAgentList step from Flows, Rules, Forms and Reports > Flows > Wizards > AgentFlowsAndRules category.
Then, on the outcome from GetAgentList we add Run Agent Flow step from Flows, Rules, Forms and Reports > Flows > Advanced category.
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.
Next on the right side, pick the previously created flow. In this example select **Write File Flow ** and pick.
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.
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.
Back in the Designer Folder we locate thumbnail for our Main Flow and click Action > Run Flow on the thumbnail’s menu.
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.