Steps to implement passing AppsFile between UiPath Studio and UiPath Apps:
- Define the AppsFile Output Argument in UiPath Process:
- In UiPath Studio, when designing your automation process, you can define an AppsFile output argument. This argument will store the file that will be passed back to the UiPath App.
- To do this, you need to define a Variable of type UiPath.Apps.Models.AppsFile in the Arguments panel, and set this variable to be an Output argument.Steps:
- In your workflow, create a variable of type AppsFile (
UiPath.Apps.Models.AppsFile). - Add the
Assignactivity (or other activities that generate or obtain a file) to assign a file to this variable. - The file can be created, fetched, or processed in the workflow. For example, it could be a file created using Write Text File or Read File.
- Assign the File to the Output Argument:
- After the file is generated or processed within your workflow, assign the AppsFile variable to the output argument.Example:
vb
Copy code
outputFile = new UiPath.Apps.Models.AppsFile() With {
.FileName = "sampleFile.txt",
.FileSize = 1024,
.FileContent = "Your base64 encoded file content here"
}
- Publish the UiPath Process to Orchestrator:
- Once the workflow is ready, publish the process to UiPath Orchestrator.
- Create an UiPath App with an Action to Trigger the Process:
- In UiPath Apps, create a new app or modify an existing one.
- Add an Action to the app that will trigger the UiPath process you just published.
- In the action’s Arguments, include the AppsFile output argument.
- After the process completes, you can use the file returned as an output for further processing within the app.
- Pass the AppsFile to UiPath Apps:
- Once the process is executed, the AppsFile output will be returned to the UiPath App.
- You can use this output in your app for tasks like displaying the file for download, processing it further, or any other desired actions.