Writing File Using Agent
- Updated On 04 Jan 2021
- 1 Minute 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, a simple .txt file (Test.txt) is used to write to the client machine using an 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, provide a full path to determine where to create a file on the Client machine, as well as the file Name.
Next, connect the outcome from the Create File step to the End Step in the Flow.
Finally, in the Flow Settings change Behavior Type to Agent Flow; this completes the Flow. Now save the Flow and 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 add GetAgentList step from Flows, Rules, Forms and Reports > Flows > Wizards > AgentFlowsAndRules category.
Then, on the outcome from GetAgentList add Run Agent Flow step from Flows, Rules, Forms and Reports > Flows > Advanced category.
Next, 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, connect the outcome from Run Agent Flow to the End Step in our Flow. This completes the Main Flow. Save the Flow and close Flow Designer.
Back in the Designer Folder locate the thumbnail for the Main Flow and click Action > Run Flow on the thumbnail’s menu.
The Flow runs silently with no User Interactions. Switching to the Client machine will display the text file created in the location defined in Write File Flow.