Output OL Connect Image files to folder that is UserName

The issue we are having is that we have another software that we import a lot of our letters to, so our processes print a physical copy and then a digital pdf/pdi/xml copy to a network folder. For our testing environment, we have a program that we run manually that takes those files and imports them into another software. But we have multiple people working on separate projects at the same time. So if someone needs to import something, then everything in that folder will be imported when they run the import program. So I am trying to separate their work out so that they can move their files manually to the folder when they are ready to import.

So I need to know how to have planet press workflow use the person who is generating the files username as the folder it will output to. So when someone processes a file to print, it will generate their OL Connect Image files to a network folder into a Sub-DIR that is their Name. I was thinking of being able to run a custom script to connect to Active Directory potentially to accomplish this.

You could do that but even running that script, you’ll need something somewhere that is an indicator of who’s running the job. Workflow always run under the same user so you can’t look at that.

Got anything in the incoming data that you could look for?

If you begin your process with a NodeJS input, you can capture the IP address of the user making the request. Or even serve back a page where they can enter their username or some other unique token (or turn on authentication for the NodeJS input). Your landing page could also include a “File Upload” feature so the user can login and upload the file they need processed.

Or start with one of the Email inputs, and have your users attach the data file to the email. You could then capture both the data file to process and the “From” address of the sender.

1 Like

I’m interested in that “serve back a page where they can enter their username” option. I wasn’t aware that I could do something like that.

What I ended up going with was using the “Owner” detail in the security tab of the file. I made a VBscript to run a powershell script that would read the file owner name and store it in a variable and then use that variable to output the PDF’s DIR to.

I had to select the Archive attribute on the folder capture step so that the file wouldn’t disappear immediately and I couldn’t read the owner name. So I just remove the data file at the end of the workflow. I’m using the default Job Variable %1 to extract the data filepath and name.

Dim filePath, objShell, objExec, ownerName

filePath = Watch.ExpandString("%1")

' Create Shell Object
Set objShell = CreateObject("WScript.Shell")

' Run PowerShell to Get File Owner
Set objExec = objShell.Exec("powershell -command ""(Get-ACL '" & filePath & "').Owner""")

' Read Output
ownerName = objExec.StdOut.ReadLine()

If ownerName <> "" Then
    Watch.Log "File Owner: " & ownerName, 3
    Watch.SetVariable "FileOwner", ownerName
Else
    Watch.Log "Could not determine file owner.", 2
End If

' Cleanup
Set objExec = Nothing
Set objShell = Nothing

Here’s some other posts that talk about the login page from NodeJS:

NodeJS Authentication - OL Connect Professional / Workflow - Upland OL User community
NodeJS LDAP Login screen - OL Connect Professional / Workflow - Upland OL User community

You could as well go for this solution: Sample Project: Serving a Web Page

2 Likes