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

Question

Question

Create shortcut to URL

asked on October 16, 2017

Good morning,

I have a Workflow in which I'd like to create a shortcut to to a path. I'm using the "Move or Copy" activity to set it to create a Shortcut.

However, I don't know how to reference the shortcut in this activity.

For example; let's say that I have a path "this/that/thisandthat/file.pdf". I want the shoutcut to point to that path, but I don't know how to point to it properly. I created a Token and added the path value in there, but when I try to in the "Entry to Move" section, I don't see the token. I can see "Starting Entry" and other "Create Entry" activities, but not the token.

What should I try instead? Any ideas or suggestions?

Thank you,

Raul Gonzalez

shortcut.PNG
shortcut.PNG (12.58 KB)
0 0

Answer

SELECTED ANSWER
replied on October 16, 2017

The remove function removes values from a multi-value token that match exactly what you enter.  It does not remove only part of the text.  For that you would need to use a regular expression.

 

pathexpression.jpg
0 0

Replies

replied on October 16, 2017

Is the original path a document within Laserfiche?  Then you need to "find" the document first.  You can use the Find Entry activity to find the document if it was not identified some other way in the workflow.  Then on the shortcut, point to the find entry output entry.

0 0
replied on October 16, 2017

MMMM, the entry sometimes it doesn't exist so it's throwing an error because it can't find it. Eventually it will be placed in that folder, but it could be later, after the shortcut was created.

I'm thinking of a different approach. A while back Jason Smith helped me with something similar. What I wanted to do was turn the forward slashes of a path into backslashes. This could work similarly if I turn "this/that/thisandthat/file.pdf" into "this\that\thisandthat\file.pdf" then extract the last part and make it the entry name or something. Then I could use the Create Entry activity and crate a folder structure like "this\that\thisandthat\" and give it the Entry Name "file.pdf" and then remove the ".pdf" or something. 

I don't know. I might be over-complicating things. What do you think? Below is the Post from Jason Smith

https://answers.laserfiche.com/questions/127477/Split-value-in-Workflow#127479

%(Token1#@Split(//)@##[\]#)

0 0
replied on October 16, 2017

You can't create shortcuts to things that don't exist. Why do you need a shortcut before the actual file is brought into Laserfiche?

0 0
replied on October 16, 2017

Miruna, I guess the initial intention was to create a shortcut that would already be ready for when the file was uploaded. This is part of a migration that we are doing. 

However, it might be worth reviewing the process so that we don't end up with shortcuts that don't exist.

At the very least I'd like to be able to crate the parent folder, even if it's empty.

So, the value "this/that/thisandthat/file.pdf" should create a folder "this\that\thisandthat\"

How can I remove the last item in the array so that I end up with the desire path? I'll try toying with %(Shortcut Target#@Split(//)@##[-1]#) to see if I can extract the last part and keep the rest. As of now, it only gives me the last part. What I want, is for it to give me all, except the last part.

0 0
replied on October 16, 2017

You can have a workflow that starts on document creation and makes the shortcut. So when you migrate these documents in, their corresponding shortcuts are created as well.

What is not clear to me is how the path you're trying to make a shortcut into relates to the document. It seems to be the actual path the document lives in, so why do you need a shortcut too?

0 0
replied on October 16, 2017

The path "this/that/thisandthat/file.pdf" comes from an xml file so it looks like

<some tag>blah</some tag>

<shortcut>this/that/thisandthat/file.pdf</shortcut>

<other tag>other things</other tag>

This XML is dumped into a general folder, which kicks off the Workflow. The "shortcut" value is placed in a "Read XML File" token so that it can create the shortcut.

The file and path could or could not exist yet. For now we are just running the Workflow every time an xml file is dumped into the general folder.

The shortcut itself can be placed somewhere else of course, right now I'm using the same path for testing purposes.

0 0
replied on October 16, 2017 Show version history

This is what I have so far. Two tokens that mess around with the original path. Next I need to update the "Shortcut" token so that it removes the last part, but for some reason it's not working.

I'm trying: %(Shortcut Target#@Remove(%(Shortcut Target - Last Part))@#)

shortcutToken.PNG
0 0
replied on October 16, 2017

I also tried directly:

%(Shortcut Target#@Remove("file.pdf")@#)

and

%(Shortcut Target#@Remove('file.pdf')@#)

but the "file.pdf" sticks. Am I using it wrong?

0 0
SELECTED ANSWER
replied on October 16, 2017

The remove function removes values from a multi-value token that match exactly what you enter.  It does not remove only part of the text.  For that you would need to use a regular expression.

 

pathexpression.jpg
0 0
replied on October 16, 2017

Jennifer,

That seems to do the trick for the first part. I'll keep toying with the different settings to continue forward with this project.

Thank you,

Raul Gonzalez

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

Sign in to reply to this post.