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

Question

Question

Question about Workflow and using file extensions

asked on October 31, 2017

I'm still getting my feet wet with laserfiche workflow and I'm not sure how to best fix my problem.

I have documents that need matched up to sql data by filename.  The sql table contains a column called "filename" that contains a list of files named in full (example: 001.jpg).  I have workflow query the data by the filename column using the value %(ForEachEntry_CurrentEntry_Name) .  However, it won't find any matches because the entry name doesn't contain the extension so it's looking for 001 and not 001.jpg.  Can I fix this with a simple regex at the end of my value that tells it to ignore the .jpg?  Thank you!

0 0

Answer

SELECTED ANSWER
replied on October 31, 2017 Show version history

Okay, then that means the files have been converted to Laserfiche pages, so they are no longer JPG files in the repository (Documents instead of Electronic Documents).

That being the case, you have two options

  1. Manually add the extension in your workflow query parameter, like so
    • %(ForEachEntry_CurrentEntry_Name).jpg
  2. Have the query ignore the extension entirely (requires custom query activity and would likely be slower because it is evaluating the text), which would look something like
    • SELECT * FROM [dbo].[table] WHERE [fileNameColumn] LIKE '@FileName%'
    • Then, under Parameters set one with the name @FileName, and set the value equal to %(ForEachEntry_CurrentEntry_Name)

I favor the first option if you know the extension will always be .jpg because it will run faster, but if the original file extensions may vary, then you might have to go the other way to make it more dynamic.

 

Depending on how you are importing the documents and whether or not they are already in the repository, you might also be able to create a field like "OriginalFileName" and store the full name and extension for searching the database.

The advantage of that is you could restrict access to that specific field so there's far less risk of someone changing the value. If you are searching based on the entry name in the repository and someone renames it, then you might have no way to find it in the database.

1 0

Replies

replied on October 31, 2017 Show version history

If you're using a Find Entry, Find Entries, or Search Repository activity, under Additional Properties there is an option for "Extension" that will provide the extension of the electronic file in Laserfiche.

Once that is added, you could use that to to get the complete file name with the .jpg at the end, just be sure to add the period between the name and extension.

%(ForEachEntry_CurrentEntry_Name).%(ForEachEntry_CurrentEntry_Extension)

1 0
replied on October 31, 2017

It still didn't work, but before I troubleshoot my workflow, do I need to turn on the 'Retain file extensions in electronic document names' feature in laserfiche for this to work?  

0 0
replied on October 31, 2017 Show version history

No, that option just puts the extension in the Laserfiche entry name so it wouldn't be static like the extension property.

I'm assuming everything works correctly when you test the query manually.

So, the first thing we need to find out is exactly what value was returned by those tokens and got passed along to the query.

If you ran the workflow manually, you should have a tokens tab so you can check what extension was returned.

 

0 0
replied on October 31, 2017

There's no tokens tab after I run it, unless I'm looking in the wrong place.  When I import jpegs into laserfiche, do they remain jpegs or are they converted to a tiff or pdf?  When I test the query I get 0 results but I seem to always get 0 results when testing the query even on workflows that work just fine.

0 0
replied on October 31, 2017

That doesn't sound right. You should get results if you're entering valid test values.

Find one of your test documents in the repository, right-click it, open Properties, and check under the Document tab to confirm it still has an extension.

Depending on your settings, some files like JPG, PNG, etc., may be automatically converted to Laserfiche Pages on import.

1 0
replied on October 31, 2017

I get results from the "search repository" but when testing query I get 0.  Also, I have no Electronic Document Properties when right clicking on the file.  It doesn't give me an extension or anything.  Just (Document has no electronic file) next to file size.  When I copy the file out of laserfiche onto my desktop it's a .pdf instead of a .jpg like it originally was before importing it.  

 

0 0
SELECTED ANSWER
replied on October 31, 2017 Show version history

Okay, then that means the files have been converted to Laserfiche pages, so they are no longer JPG files in the repository (Documents instead of Electronic Documents).

That being the case, you have two options

  1. Manually add the extension in your workflow query parameter, like so
    • %(ForEachEntry_CurrentEntry_Name).jpg
  2. Have the query ignore the extension entirely (requires custom query activity and would likely be slower because it is evaluating the text), which would look something like
    • SELECT * FROM [dbo].[table] WHERE [fileNameColumn] LIKE '@FileName%'
    • Then, under Parameters set one with the name @FileName, and set the value equal to %(ForEachEntry_CurrentEntry_Name)

I favor the first option if you know the extension will always be .jpg because it will run faster, but if the original file extensions may vary, then you might have to go the other way to make it more dynamic.

 

Depending on how you are importing the documents and whether or not they are already in the repository, you might also be able to create a field like "OriginalFileName" and store the full name and extension for searching the database.

The advantage of that is you could restrict access to that specific field so there's far less risk of someone changing the value. If you are searching based on the entry name in the repository and someone renames it, then you might have no way to find it in the database.

1 0
replied on October 31, 2017

The extension is only available for electronic documents. Your JPG would become an image page when imported, with no electronic document component.

2 0
replied on October 31, 2017

Luckily this is just a one time thing to populate the metadata in these files.  Once I get all 165 of them processed, I'll be done.  Thanks for all your help.  I'll let you know how it works out.

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

Sign in to reply to this post.