Hi,
following the tutorial for HR_Assessment in "Building a process" there is a folder created for a hire.But any time the process is resartet for debugging or testing, the folder "HR_Lucie_Pressnel" for example gets created over and over again, each time with an new id, but same name.
I tried to modify the example by testing for the existence of a folder with the same name, but cannot find a suitable function/Smart Service.
Why?
Some people suggest to use a database to store all the information the KC or the folders already represent. And it assumes that you always have a database with this information to search for.
But is it realy neccessary to build complex database storage and query function for a simple
(list) listDir() or (int) getDocumentByName(name) function?
Thx
Olaf
Discussion posts and replies are publicly visible
Hi Olaf.
It's not necessary to develop extensive database structures to work with files and folders.It's typically enough to store the folderId property ("id").
You can capture this value on the outputs tab of the create folder task with a custom output like: folder(ac!NewFolder,"id") .
Store the result into a PV of type number (integer).By placing that value alone in the database, you can reference the folder created for a specific case easily as needed.
thanks for your answer. Appreciate it.
You are right. "extensive database" operation is not needed here.
but your answer shows me also that there is indeed always a database operation needed in order to handle folders.
It is not just done by a function or rule.
you do need to make a query to the database and lookup "name" or "id" or" folderid" in case a new hire is showing up. You canot just get a list of dirs as array and index(list,item,default) on it, without the database.
but it is as it is, and it is not a problem at all.
thx again.
The other thing to keep in mind is that most of the time when you upload files to Appian, you want to associate them with some business data that already exists in a database. For instance, you might have documents related to a case. So it's not required to store information about folders / documents in the database, but it's the most convenient since the other data already exists there.
That is a very good point!