Is AppsFile in UiPath Apps a custom class or module?

Hi everyone,

I came across AppsFile while working with UiPath Apps, and I was wondering if it’s a custom class or a module specific to UiPath Apps.

AppsFile is not a custom class that you need to define, nor is it a standalone module. It is a predefined object class within the UiPath Apps environment, specifically designed for handling file uploads, downloads, and interactions within an app.

In UiPath Apps, AppsFile is used to represent files that users upload, enabling you to manage files within the application. It is a built-in entity rather than something custom that you would need to create. You can use it in your app to handle file data (e.g., filename, file size, content) for various processes, such as file validation, file input from users, and passing files between different processes in your app.

So, to clarify, AppsFile is part of the UiPath Apps framework, not a custom class or module

@saikrishna.kakkat,

AppsFile is a special datatype in UiPath Apps to keep a file in memory for further use. For example you need to use any file from storage bucket, you can get it in a AppsFile datatype variable and pass it to a control like image or Document Viewer.

Thank you for the clarification on AppsFile! I understand that it’s a special datatype in UiPath Apps for handling files in memory. I’d like to know if it’s possible to create an AppsFile as an output argument in a UiPath process and pass it back to UiPath Apps for further use.

If yes, could you please provide guidance or examples on how to implement this?

Steps to implement passing AppsFile between UiPath Studio and UiPath Apps:

  1. 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 Assign activity (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.
  1. 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"
}
  1. Publish the UiPath Process to Orchestrator:
  • Once the workflow is ready, publish the process to UiPath Orchestrator.
  1. 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.
  1. 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.

I couldn’t find UiPath.Apps.Models.AppsFile in references. Could you please let me know if this is available?