Skip to main content

Requirement: Display the pdf file in the Document Area of AARI Desktop.

Scenario1 - Expected Functionality

1. I have used "Interactive Forms" Action in Task Bot

2. Used "Set value" to Form Name:<Form>, Element:<Document Element>, File Location path: <C:\Users\"username"\Documents\Test.pdf>

3. Run the Bot, "Test.pdf" file is displayed at Document Element. Which is Good.

Scenario 2 - AARI Desktop

1. I have used new form with "Select File" element.

2. I have created another new form with "Document" element.

​​​​​​​3.Created a new Process and Added Human Task "Form with Select File - Step1"

3.1. Added a Select file element - User should click the browse and select the file

​​​​​​​4.Added a new human task with Document element (Step-2) and set Form Data Feed of Document Area to "UploadFileElement.Output".

5.click Run. User Selected the file through Browse button and the selected file will be displayed at Document Area.

But my requirement is the document should be displayed in AARI Desktop according to the

Scenario-1.    How should I achieve this requirement?

 

1. I have created a form with "Document" element and set Default File value as "<C:\Users\"username"\Documents\Test.pdf>".

2. Created a new process and Added Human Task with Document Area

3. Run the Process, File is not displayed at "Document Area", and page is in buffering.

 

Did you get this working?


Did this work for you? Did you find any workaround for this issue?


Same issue. Unable to load the document in the document area and the page is buffering. Any solution


any one found a solution for this?


Hi All,

 

To display a PDF file directly in the Document Area of AARI Desktop (like Scenario 1, where the Task Bot's Interactive Form with a Document element shows the PDF correctly), but within an AARI Human Task form (Scenario 2), you need to handle the file input differently because:

  • In Scenario 2, the Document element in the Human Task expects a file content or a valid accessible file URL, not just a local file path on the machine running AARI Desktop.
  • Setting a local file path as the default value in the form’s Document element does not work because the AARI Desktop runs remotely or in a different context, so it cannot access the local file path directly.

Method 1:

  1. Prepare the PDF content as Base64 string in your Task Bot or Process before the Human Task.

  2. Pass this Base64 string as the input to the Human Task’s Document element.

  3. The Document element can render the PDF from the Base64 content, displaying it directly.

Method 2:

  1. Upload the PDF file to a location accessible by AARI Desktop (e.g., Control Room file store, web server, or cloud storage with public URL).

  2. Set the Document element’s value to this accessible URL.

  3. The Document element will load and display the PDF from this URL.


Hi ​@Padmakumar 

Thank you for your response.

I am trying second method particularly.
 

  • Created form1 with just Select File element.
  • Created form 2 with Document viewer element, where I am passing selected file from form 1 as input to form 2 which is working fine.
     
     

    Now this approach involves extra human interaction which is to select file in form 1.

    Trying to prevent this by using Process composer: Upload storage file action, I can get the URL of file where it is uploaded but cannot pass to form 2 as it expects FILE type and not string.
     

Hi ​@Padmakumar 

Thank you for your response.

I am trying second method particularly.
 

  • Created form1 with just Select File element.
  • Created form 2 with Document viewer element, where I am passing selected file from form 1 as input to form 2 which is working fine.

     
     

    Now this approach involves extra human interaction which is to select file in form 1.

    Trying to prevent this by using Process composer: Upload storage file action, I can get the URL of file where it is uploaded but cannot pass to form 2 as it expects FILE type and not string.
     

 

Upload the file using the Upload storage file action to get the file URL or reference. You may need to download the file programmatically in the bot/process using the URL and assign its path to a File-type variable. Pass this variable as input to the document element in the human task form.


Hi ​@Padmakumar 

I tried same, file is uploaded and got the path as well like “crdata://aari/v2/files/{fileId}?fn={fileName}”

but getting error when trying to get that into a FILE variable “Get Resource failed. Error: Could not find the file“

 


Hi ​@Padmakumar 

I tried same, file is uploaded and got the path as well like “crdata://aari/v2/files/{fileId}?fn={fileName}”

but getting error when trying to get that into a FILE variable “Get Resource failed. Error: Could not find the file“

 

 

The crdata:// URL format is an internal Control Room reference and cannot be directly used to retrieve the file as a File variable. Which is why I had mentioned in my previous comment to implement a file download step in your workflow.

 

Use the File → Copy Control Room file action to download a copy of the file to your local folder. Then, replace the value of the $res$ variable with the local file path and give it a try.

 

 


With local file path as reference, problem is that the document viewer in forms within AARI keeps on loading/spinning/buffering. (coming back to main issue)

And got to know the reason as well why that happens from official documentation below,
  
Note: Because of the security restrictions that modern browsers apply towards accessing local files, uploading a document to Automation Co-Pilot or Document Automation storage is a prerequisite to use files in web forms (such as displaying it in a Document element). Therefore to display local files, we recommend that you use an Interactive Form in an attended bot. When designing a web form, the default local file path is not applicable.

link here


With local file path as reference, problem is that the document viewer in forms within AARI keeps on loading/spinning/buffering. (coming back to main issue)

And got to know the reason as well why that happens from official documentation below,
  
Note: Because of the security restrictions that modern browsers apply towards accessing local files, uploading a document to Automation Co-Pilot or Document Automation storage is a prerequisite to use files in web forms (such as displaying it in a Document element). Therefore to display local files, we recommend that you use an Interactive Form in an attended bot. When designing a web form, the default local file path is not applicable.

link here

 

 

Here is a sample process that I made to showcase the same. I am using two forms; one is to choose a file (I hope in your case, this is where human intervention is required), and the second one is to display the same.

 

In between, I am also using a task bot to convert the String-type (file path) variable to a File-type variable. This will be assigned to the Display Form as an input.

 

 

 

 

Output

 

 


Reply