cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Workflow Hero

Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

IN Nintext Workflow + Forms (on-premises) I'm trying to build a dynamic string containing up to 3 hyperlinks.

 

In a Build string action, I construct a HTML hyperlink to a task response form, as follows:

 

<a href="{Common:WebUrl}/Lists/Workflow Tasks/EditForm.aspx?ID={WorkflowVariable:idTaskIDBranch1}">{WorkflowVariable:txtSoortActie1}</a>

 

and store the output in a single line text variable linkTask. I do this 3 times, so I have 3 separate workflow variables linkTask1, linkTask2 and linkTask3, each containing a hyperlink.

 

I then want to build combine these 3 variables into a single multiline text field variable, as follows:

 

{WorkflowVariable:linkTask1}<br/>

{WorkflowVariable:linkTask2}<br/>

{WorkflowVariable:linkTask3}

 

This variable is then written to a SP list in a multiline text field (type Enhanced).

 

PROBLEM: only the last hyperlink {WorkflowVariable:linkTask3} is created in the multiline text field. Links 1 and 2 two are 'ignored'. The end result is like:

 

<br>

<br>

<a href="http://site/Lists/Workflow Tasks/EditForm.aspx?ID=123">hyperlink text</a>

 

The strange thing is that it works fine when I hardcode three hyperlinks into the mutline text field. It fails only when I use the workflow variables in the manner described. I am stumped and have spent hours trying to solve this. Any assistance woudl be highly appreciated.

 

Kind regards,

 

Robert van Raamsdonk

Labels: (2)
0 Kudos
Reply
7 Replies
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

Hi Robert,

Have you added any logging to the workflow history so you can see the contents of each linkTask variable?

I've just run a quick test to see if there is an issue with this but it does all seem to work ok, I used a Build String action for each link and then another Build String action to combine the 3 links together and stored the result in a multi-line text variable at the end and used this to update the list item.

Please could you paste some screenshots of your workflow and action settings if you're still stuck?

Thanks

Jan

0 Kudos
Reply
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

Hi Robert,

use the Log actions to log the other variables (linkTask1) and (linkTask2).

Make sure they do in fact contain data.

I sometimes get caught by this, whereby I have multiple Build String actions that I've copy and pasted then edited.  I've edited the body of the text, but forgot to change the Store Result in variable, and they were all storing the result into one variable.

cheers,

Vadim

0 Kudos
Reply
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

Thanks to Jan and Vadim for their swift response! Meanwhile, I got this to work, but don't quite understand why...:-).

 

One thing I did not mention in my problem description - which may or may not be relevant - is that my 3 WF tasks are created in a parallel action. Each of the linkTask1, linkTask2 and linkTask3 WF variables are created in their own branch, then after completion of the parallel action, I concatenate the 3 variables into a single multiline text variable. This is the scenario that kept failing. And yes, I was logging all variables everything to the History List and was able to verify that the 3 link variables were perfectly OK. Just the cncatenation kept failing in the manner described above.

 

Ultimately, by skipping the creation of the 3 individual variables, and instead constructing the hyperlinks directly in the multiline text variable (after completion of the parallel action), it started working!

 

So instead of

 

{WorkflowVariable:linkTask1}<br/>

{WorkflowVariable:linkTask2}<br/>

{WorkflowVariable:linkTask3}

 

I now do

 

<a href="{Common:WebUrl}/Lists/Workflow Tasks/EditForm.aspx?ID={WorkflowVariable:idTaskIDBranch1}">{WorkflowVariable:txtSoortActie1}</a><br/>

<a href="{Common:WebUrl}/Lists/Workflow Tasks/EditForm.aspx?ID={WorkflowVariable:idTaskIDBranch2}">{WorkflowVariable:txtSoortActie2}</a><br/>

<a href="{Common:WebUrl}/Lists/Workflow Tasks/EditForm.aspx?ID={WorkflowVariable:idTaskIDBranch3}">{WorkflowVariable:txtSoortActie3}</a>

 

and that works....Go figure. Any thoughts are appreciated, I don't like not understanding why something did not work...

 

Kind regards, Robert

Reply
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

Hi Robert,

I'm glad you got that resolved, although it is definitely bizarre as this should have worked.

The Build string action is about the simplest action, and I haven't seen it behave this way.

Either way, if it comes up again, let us know.

Vadim

0 Kudos
Reply
Not applicable

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

Hi, Robert van Raamsdonk​! If you have a solution, can you select a "correct answer" from this thread? It's helpful for other community members seeking correct answers. If you're still looking for your solution, keep us posted. Thanks!

0 Kudos
Reply
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

The problem with this issue that it seems local to my situation, and that I worked around it rather than solve it. According to the experts above, the original approach should have worked just fine. But it didn't in my case. So there is no 'correct answer': however, I marked my own description of the workaround as the answer, because it solved my immediate problem.

0 Kudos
Reply
Workflow Hero

Re: Build string problem: concatenate 3 string variables containing <a> tags into single text WF variable

Jump to solution

I had a similar issue in Office 365. I was trying to build a string which would take an existing multiline text field and add a new variable onto it each time the workflow ran. For some reason the list item text field would show in logging, but wouldn't show in the build string output! After putting the list item text field into a separate variable first, and then appending the two workflow variables, it now works. 

0 Kudos
Reply