HTML in a workflow variable getting stripped out when used in a Flexi task description


Badge +3

On my workflow, I'm setting a variable containing HTML tags (This is what it looks like sort of: <table><tbody><tr><td>Product</td></tr><tr><td>000-4551</td> .....)

When I go use this variable in my Flexi task's task description field and run the workflow, The HTML is stripped out and everything is just in one line.

Is there a way to preserve the HTML?


21 replies

Userlevel 6
Badge +12

Hello -

I have been unsuccessful in adding HTML to actions other than to a notification. Even in the notification it does not come out that great. I recently have been working with more XML and XSLT and then dumping that into a notification and seems to be much better experience.

Something like this:

182193_pastedImage_0.png

We took the XML from the item and then processed it using XSLT in the Quesry XML action.

Badge +3

Oh okay. I'm guessing I can't preserve and use the HTML in a variable then for what I want.

Badge +5

Hello Kei,

I'm able to get HTML Tables in my Flexi Task but I do it outside of the Task.

I have a Build String Action with my HTML that is in a Variable (Multiple Lines of Text) lets name it m_txt (Variable)

I use that variable in the Flexi Task email.

Can you explain what is in the HTML table?Ā  For instance in my I have items that need to be reviewed. I add those items in the variable and that variable in the Flexi task.Ā  So my users opens up the email and sees that needs to be reviewed.

Badge +3

Yes, I require something similar. The variable is actually coming from a loop that goes through a repeating section of a form.

The Flexi task description will then need to display this information for the approver to approve/reject.

Userlevel 6
Badge +12

I was just testing this and it seems to be working. I have not tried any styling, but if it is all in-line should work in the Build String Action and then you can use it in your other actions.

Badge +3

Okay here's what I have right now, let me know what I need to change:

- Multiline text variable containing said HTML.

- This variable is inserted as a reference to the 'Task description' field of a Flexi task under the 'Action' tab.

- On the "Task Notification' tab, it is a Rich Text and 'Task Description (HTML)' is inserted as a reference.

Badge +5

That's exactly what I do!!!Ā  You maybe need to do it in a few steps

1. Top of Table (Build String) - Store it in m_txt

<table><tbody><tr><td>Product</td><td>Feild 2</td>

2. Run your loop - assume you are holding the values in variables

3. Body of Table (Build String) - Store it in m_txt

{Vaiarble:m_Txt}Ā  <td>ProductField</td><td>FeildField</td>

4. End of Table (Build String) - Store it in m_Txt

{Vaiarble:m_Txt}Ā  </table></tbody>

then the Flexi Task in the email add the {Vaiarble:m_Txt}Ā 

Makes Sense?

Badge +5

It looks like we posted at the same time! take a look

Badge +3

Haha, yes this is how the variable came to be on my end as well.

But I guess I'm placing my variable inside the Task description field instead of the Task Notification email body directly which is why the HTML is getting stripped out(??)

Badge +5

let me know if it works out!

Badge +3

Yep it does seem to be the case that if I put the variable in the Task Description, the HTML does get stripped out on the Approve/Reject form. If I put in the email body directly, it displays it on the email just fine. I guess I'll just have to make do with this.

Thanks so much!

Badge +5

@kei

What did you want to do? Maybe I've already figured it out?

Badge +3

Oh I simply wanted the variable's value including HTML to be preserved when it's displayed on the approve/reject page in SP. I understand that it's possible on the email task sent out, but I'm talking about the SP page.
I hope this makes sense.

Badge +5

You want the HTML Table to be displayed on a SharePoint Page?

I did this with a Wikipage I had a WF that would create a Wikipage Name the page and in the body I added my HTML and it worked great.

Badge +3

I've attached a screenshot. Hopefully this would make it clearer.

It's the task approval page. The encircled text is supposed to be a table split up into two rows.

Badge +5

Hmmm I feel like this can be done!

Can you try this update the "Additional Security Access" field. You should be able to update the field with a Value that value would be the m_txt ( you need to put it in another HTML table, so the m_txt variable in the <html><body>Variable ></html></body>, you get the idea).

that way it will show up in the field. you want try this in a wiki page just to make sure it works there first.

Badge +3

'Additional Security Access' isn't a real field. It's just static text used as a header.

I'm not trying to create a page through a workflow based on this value. This is just the default task approval page generated by the Flexi task.

Badge +5

Ok when you say page. You mean what ? a Wikipage orĀ  Task

Badge +3

It's the page you're sent to when you view details on the email notification you get asking you to approve or reject the task.

The page URL ends in /_layouts/15/NintextWOrkflow/ApproveReject.aspx

Badge +5

I'm sure there is a way!!! I just don't know how to help you.

I'm using a simple info path form on my flexi task. The reason was because we wanted to add additional text to the form. If you figure it out PLEASE Share!!

Badge +3

Will do.

Thanks again! grin.png

Reply