Skip to main content
September 2, 2023
Question

Moving documents to existing folder issue

  • September 2, 2023
  • 5 replies
  • 0 views

Hi Team,

I'm using a single process model for creating employee and updating employee(related action). While creating employee simply i create a new folder and move employee documents there. But incase of updating i need to add documents to the same folder. I don't know how to achieve this. I tried with tofolder("emp 1") function with a or gate to check whether it's updation or creation but getting error. Then i removed or gate and checked with the create folder then move documents methods again for updation process it creating a new folder with same name. Need support on this..

Thanks in advance 

    5 replies

    mathieud0001
    September 2, 2023

    I would suggest you create a constant for your folder and use that instead.

    September 2, 2023
    • But my task is to create a dynamic folder,like one folder for one employee then while updating i need to move documents to the same folder which has been created during the employee add process
    mathieud0001
    September 2, 2023

    You can do tofolder on a folder id if you stored it in the database in relation to your employee. Not the folder name (it is not unique)

    mikes0011
    Brainy
    September 2, 2023

    As Mathieu already mentioned - in Appian, a folder is stored as an ID (that is the only unique aspect of any given document folder, to put it simply).  When you create a folder based on a particular person, you will need to store its ID (integer) into a place that's easy to look up later on - like a column on that person's database table row (if you don't have a database table to store data related to each employee, you will need to set one up).  Then later on you can simply reference the folder by id after querying the database row for that person.  The appian type of "folder" really just holds an integer, so you can cast between the types pretty freely.

    September 2, 2023

    Thank you Mike. It's working fine now