You are viewing limited content. For full access, please sign in.

Question

Question

Dynamic List populated from Repository Folders

asked on June 16, 2021 Show version history

I may be missing something, but I have not been able to figure out if this is possible. 
 

We use Laserfiche cloud hosting and have no direct access to the database. 

We are creating an HR process, where the Human Resource department will create a folder for an employee under their respective location.   The users will then use forms to submit documents to this location.  To prevent user error, we would like to generate a dynamic list of "Users" from the repository folders that are created by HR and then present them in a drop down manner to users in a form.  This list would need to update whenever HR creates a new folder in this location.

Can this be done?

Thanks in advance.

0 0

Answer

SELECTED ANSWER
replied on June 16, 2021

Yes this can be done - but will require some set-up in the SQL environment.
two options I can think of:

  1. Workflow (Easier) option.  Set-up a custom database table with the list of "users".  Set-up a Workflow that runs on a scheduled basis and searches the repository for the names of the folders, and updates or inserts them to your custom database table.  Even better - make the creation of a folder trigger the workflow, rather than relying on the schedule.
  2. Database-only (Harder) option.  In the database for the repository (it'll be named something like MAIN8), there is a table in here called toc (table of contents).  If you determine the entry ID of the parent folder, you can search for the name of all items within that folder, like this: 
    SELECT
      [tocid],
      [parentid],
      [name]
    FROM [MAIN8].[dbo].[toc]
    WHERE [parentid] = 1

    If you set-up that search query as a View, you can then set-up LFForms to be able to use that View in form lookups.

2 0
replied on June 16, 2021

Im sorry,  I forgot to mention that we are on the cloud hosted version of Laserfiche. I do not have access to the database in that manner that I am aware of. 

1 0
replied on June 17, 2021

Okay, so that would kill option #2.  But you still should be able to use option #1.

If you don't already have a custom database set-up somewhere in your environment, I strongly recommend it.  It doesn't even need to be MSSQL, there are several options that Forms can connect to (we have a MySQL database that we use, plus several MSSQL).  Once you have your database set-up, you can get both Workflow and Forms connected it to, and then option #1 is possible to build out, as it would use built-in activities in Workflow to search the repository and then populate those search results to your custom database table.

1 0

Replies

replied on June 17, 2021

You should create a lookup table with a list of employees and their folder IDs (similar to the SQL table Matthew was suggestion). At first, run a WF search to get a list of the folders and add each as a new lookup table row with the folder ID. Then in your employee/folder creation WF, add a step to add the new folder to the cloud lookup table so you always have an up-to-date lookup table with employee list and folder ID. 

Once you have that, you can use that and a lookup table query to get all that information on a form. You can see a list of users in a dropdown and then grab that user's folder ID and use that in the save to repository. 

2 0
You are not allowed to follow up in this post.

Sign in to reply to this post.