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

Question

Question

Template ID Numbers

asked on July 30, 2021 Show version history

Hello,

I was wondering if templates have ID numbers that can be used by Workflows to identify them even if the template name changes. We had a case where a workflow was built but the template name was updated later (we removed an s) and the workflow stopped working. I have noticed issues like this before. This should also be the case with folder Entry IDs. Its really annoying to have to go through each workflow and update the folder paths etc. Also WF connection profile passwords which I am sure has been discussed before. I think this would be a good feature request if this is not the case.

0 0

Replies

replied on July 30, 2021

Yes, many entities in the repository - things like entries, fields, tags, and including templates -  have both an id that doesn't change and a name that can be changed but that must be unique.

2 0
replied on July 30, 2021

The Assign Field Values activity is limited in that it only takes a template name and not an ID, but it does allow you to select the template name using a token.  So you can set up a token value with the Template ID and then use an SDK Script activity to look up the Template name.

While this approach will allow for the template name to change, the Assign Field Values activity does not allow you to select fields using IDs or token values.  To assign both template and fields using IDs instead of the names, you would have to script the template and field assignments instead of using the built in activity.

        Protected Overrides Sub Execute()
            'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            Dim sTName As String = Nothing
            Dim sPSetID As String = GetTokenValue("TemplateID")
            Dim iPSetID As Integer
            If Integer.TryParse(sPSetID, iPSetID) Then
                Try
                    Dim Tmp As TemplateInfo = Template.GetInfo(iPSetID, RASession)
                    sTName = Tmp.Name
                Catch ex As Exception
                    WorkflowApi.TrackError(ex.Message)
                End Try
            End If
            SetTokenValue("TName", sTName)
        End Sub

 

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

Sign in to reply to this post.