How to get the local path of my Excel file before to launch the Robot?

Certified Senior Developer

Hi,

I have a very simple robotic process that works fine. It opens and reads an Excel file stored in specific local folder and reads some cells values. The path of the Excel file is stored in an Apian Constant and I use the "Open or create Workbook" Appian service to open this file.

My new need would be to make the selected folder path dynamic because I need a user to be able to select a directory from an Appian Interface before to call the robotic process.

I've tried to use the a!fileUploadField fonction to select my Excel file, but I don't see how to get the local directory (the component gets only the filename and the new document ID).


Is there any way to get this local file path?

Otherwise, does a best practice could be to not use a local path, but to save the Excel file in the Appian repositiory first (the Robotic process would open the Appian document, and not the local file) ?

My scenario does not need to store the Excel file in Appian, so I would prefer the 1/ solution if it is possible ?

Regards

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    when you say "local", do you actually mean within the Appian filesystem?  because it almost sounds like you mean like the windows filesystem path or something, in which case all bets are off (barring the use of some super-specialized plug-in or something).

    If you're talking about Appian folders, we have pretty high flexibility, up to and including building our own little folder explorer tools (which i've done here or there as needed).  Firstly, if you have a valid file ID, then by virtue of the document() function you also have its folder ID.  And then with that folder ID and the folder() function, you have the parent folder ID, and so-on all the way up to the very root directory.  I'm not really clear what exactly you require here, though.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Yes, I mean local file system on which my Excel file is stored (on Windows).
    My local RPA agent is stored on Windows too.

    for my first RPA test I have a static path like : c:\temp\myfile.xlsx

    but now, I would like a user to be able to select a path from the Interface of the Appian Application (as he does when he chooses a file to upload). Let's say, the user want to select "c:\temp\dir1\myfile1.xlsx"
    so I have to transmit the new path to the RPA Robot

    We need to make the user selecting the Excel file in the Windows Filesytem, and not the Appian folders

  • 0
    Certified Lead Developer
    in reply to cedric01
    Let's say, the user want to select "c:\temp\dir1\myfile1.xlsx"

    I think you'd have to build something manually and which makes assumptions about the local system's directory structure (as opposed to actually seeing the directory structure), since I'm not aware of any appian functionality (other than stuff that might exist strictly in the RPA space which i'm unaware of) that would give in-interface visibility over the contents of a user's filesystem.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Thank you for your reply, as it is,for a POC, maybe it better to add a simple Textfield and then let the user enter manually the correct path.

    In Appian there is a a!fileUploadField fonction which is used to upload a file to Appian from filesystem, So I thought this fonction could be used to get the correct path

    But I keep in mind, that using Appian folders would be a lot more flexible. 

  • 0
    Certified Lead Developer
    in reply to cedric01
    there is a a!fileUploadField fonction which is used to upload a file to Appian from filesystem

    AFAIK the file upload field provides no feedback to Appian about anything in a user's local system - the browser handles the actual locating of the file and by the time Appian sees anything, it's just the uploaded file itself.  The internals of what the field may or may not see are unclear, but nothing is exposed to the design side that I'm aware of.

  • You will find that interacting with the physical filesystem is challenging at best - a!fileUploadField will not allow you to specify any physical document path.  Additionally, Appian's content engines perform back-end translations on the document objects, in my experience filesystem folders are grouped by knowledge centers and document names are translated - they are stored as an ID, but not an ID you have access to such as via fn!document(doc,id) - (some hidden content engine ID translation).  

    The closest you might get to interacting with the physical drive is with the Filesystem Utilities plugin.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Ok, I understand perfectly this point thank you for this clarification.

  • 0
    Certified Senior Developer
    in reply to Chris

    As it is just for a POC I will choose the simple way to do it
    Thanks a lot for theses precisions