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

Question

Question

Retrieve Assigned Tags in Workflow?

asked on February 10, 2015

Hello,

I have a need to retrieve assigned tags from documents in one of my workflows. This workflow is gathering data from entries in Laserfiche and updating an external SQL table with that data. So I am looking for something similar to the Retrieve Field process, only I need to retrieve the assigned tags for each entry.

 

I didn't see an obvious way to do this so looking for some ideas.

 

Thanks!

Eric

2 0

Replies

replied on February 10, 2015

I also coded up another SDK Script Activity that accepts a tag name as a token and returns a boolean to indicate whether the tag is assigned to the entry.  (Again, using RA.  If you need an LFSO example then let me know)  This script is looking for a token called 'TagName' created by an Assign Token Values activity.  Set that token value to the name of the tag to look for and it returns a boolean token called 'IsFound'.

        Protected Overrides Sub Execute()
            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            Dim isFound As Boolean = False
            Dim tagName As String = Me.GetTokenValue("TagName")
            Dim id As Integer = Tag.GetInfo(tagName, Me.RASession).Id

            For Each eTag As EntryTag in Me.BoundEntryInfo.GetAssignedTags()
                If eTag.TagId = id Then
                    isFound = True
                    Exit For
                End If
            Next

            Me.SetTokenValue("IsFound", isFound)

        End Sub

 

2 0
replied on February 10, 2015 Show version history

Eric,

Not sure what version of Workflow you are running but here is a code snippet using RA that you can use in an SDK Script activity to retrieve the list of tag names assigned to an entry.  This works on my 9.2 system.  The script will write the tag names to a multi-valued list token called 'TagList' which can be used by other activities later in the workflow.  (If you are running an earlier version of Workflow and need to use LFSO vs RA let me know and I can provide the script.) 

        Protected Overrides Sub Execute()
            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            Dim myList As List(Of String) = New List(Of String)

            For Each eTag As EntryTag in Me.BoundEntryInfo.GetAssignedTags()
                myList.Add(Tag.GetInfo(eTag.TagId, Me.RASession).Name)
            Next

            Me.SetTokenValue("TagList", myList)

        End Sub

 

1 0
replied on February 10, 2015 Show version history

Interesting, I never needed this but always assumed workflow could access the tags.

There is one way workflow can see the tag information, through conditionals.

You would need to create a condition for every possible tag and have it assign the tag name to a multi-value global token. Only way I can see to read the tags.

0 0
replied on August 27, 2020

I created the condition to create a condition for all my tags. How do you find/ assign the tag to a token?

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

Sign in to reply to this post.