cancel
Showing results for 
Search instead for 
Did you mean: 

Get Task History and display on your form.

dan_stoll
Nintex Newbie
25 28 10.5K

Here is a little Holiday treat for everyone.. The Nintex Web Service I still believe is a little golden nugget rarely utilised.. I was presented this issue the other day from a prospective customer, and I thought  "yeah I can do that"

The idea was that in Nintex Forms the customer wanted to display the workflow audit history. EG

Display NameActivity TitleOutcomeStartEndUser Comments
Dan StollAssign Flexi TaskPending3:40 PM 23/12/2014
Eileen TanAssign a Flexi taskCompleted3:39 PM 23/12/20143:40 PM 23/12/2014(Eileen Tan) testing

Inside the form.

So without waffling to much here is a screenshot of the UDA and please find attached at the bottom.

Untitled picture.png

The main element is calling the Nintex Webservice method 'GetWorkflowHistoryForListItem' . and then using the 'Call Web Service' action to drill into the XML results to pull the information you need into Collection Variables.

Untitled picture.png

Once you have all this info you can use the same technique as you do to build a nicely formatted table for emails as posted here Formatting Results to an Email‌ .

The final result looks a little like this when the output of the UDA is set to a Rich Text box and then connected as a label in Nintex Forms

Untitled picture.png

Please note that the Webservice call action will require the correct credentials added.

Happy Holidays..

28 Comments
burkslm
Nintex Newbie

Great tidbit!

janeyres
Nintex Newbie

Thanks, I'm new to Nintex so these technical blogs are brilliant!

I do have a question though, I've created the UDA successfully (and I finally understand collection operation actions), but I'm not sure how to get the results displayed on a form. You mention sending the UDA output to a rich text control and connecting as a label but I'm not sure how to get this working. Any tips appreciated!

Automation Master
Automation Master

Nicely done

johncharles
Nintex Newbie

Clever!

jwiskema
Nintex Newbie

I created a rich text field on the SharePoint list, then sent the results from the UDA to a workflow variable, then used a "set field value" action in the workflow to set the rich text box to the value of the workflow variable and that worked.

Not applicable

Hi Dan,

That's really a nicely done! That I 've been searching such a kind of example for a long time.

However I am still not able to run it But If I want to create every item (Task Audit) in a list library

instead of getting these records as html out What should I do?

amywilliford
Nintex Newbie

Hey Dan! I've used this UDA time and time again...love it!!! One question, what if I wanted to sort the tasks oldest to newest? Would a sort Collection Operation on the user start date right before the For Each straighten it out?

Thanks!!!

Amy

dan_stoll
Nintex Newbie

Hey Amy Williford

Just thinking off the top of my head.. I don't think it needs to be that complex.. If you look at the last build string action where the table is being compiled, you will notice that the Build string variable value is actually inside the content .. So if you change the order

Instead of :

{BuildStringVarValue}

<tr><td>.....</td></tr>

make it

<tr><td>.....</td></tr>

{BuildStringVarValue}

By doing this , when the loop goes around and grabs the values, it will add the values to the table at the bottom and not at the top.

Makes sense ??

amywilliford
Nintex Newbie

Dan Stoll

That makes perfect sense!!! Always trying to make things more difficult for myself! I will give it a whirl!

Thanks so much!!!

Amy

mlauer
Nintex Newbie

Great! Just seen here and I have a use case.

Manfred

fhunth
Nintex Newbie

Hi Dan Stoll​ . The task audit table says that "Eileen Tan" 's outcome was "Custom" and in your sample it seems to be Completed.

What does it mean "Custom"?

dan_stoll
Nintex Newbie

While I'm visiting this post.. If you are using a Flexi Task you will probably note that the /Outcome node sends back a value of Custom..

To actually get the "Real" outcome, change the UDA to point to the /CustomOutcome XML node, and not Outcome.

To get even more info into your history table, goto the  If you go into the Webservice call and do the test thing

In the web service call manually change the List item ID and hit execute .. it will give you the output of all the values available to you..

trish
Nintex Newbie

Hi Dan,

I am not sure to understand what is expected in the input parameter "Workflow Name"?

Could you please give me more details?

Thanks a lot!

Trish

rickbakker
Nintex Newbie

Hi Patricia,

Without having looked at the UDA, I expect it to be the name of the workflow you want to have the history information from. So, for example, if you have a workflow called 'Approval', then that name should be inserted.

Cheers,

Rick

trish
Nintex Newbie

Thanks Rick it works!!

Cheers

Trish

spozim
Nintex Newbie

Hello

We used Nintex in our Business since a few month. Your Post is exactly was I search, but i can't open the UDA-File. How can I use it?

Sorry for my english, this is not my strength.

Thanx for a short answer a greets from Switzerlang

Martin

mislaila
Nintex Newbie

Hi,

Can anyone help me?

We get this error when workflow run the web service : Failed to invoke web service. Error returned from server: 401 UNAUTHORIZED

Thank you.

Automation Master
Automation Master

the account that invoked web service call simply does not have sufficient permissions to do so.

mislaila
Nintex Newbie

Hi ,

I use admin account to run this.

Thank you.

Automation Master
Automation Master

Check if you have "Workflows can use app permission" site level feature active.

Regards,

Tomasz

mislaila
Nintex Newbie

Hi ‌ ,

Do you get to sort the task from oldest to newest?

mislaila
Nintex Newbie

Thanks Tomasz!

It works in our production but didn't work in our development environment. Need to further check later.

dan_stoll
Nintex Newbie

Hey Martin, sorry just seeing this for the first time.. the one thing with UDAs is that you have to import it as a UDA. Are you trying to do that or as a workflow ? EG, don't create a new UDA and then try to import it. 

spozim
Nintex Newbie

Hi Dan. Thanks for your answer. I have found the solution in the meantime and it works fine.

Cheers,

Martin

kalle
Nintex Newbie

Great post Dan Stoll and exactly what I am looking. Unfortunately, our company has limited the access to the Webcall Service. So we always receive an error message when importing the UDA. Besides the fact, that only the IT department has access to UDA... 

Does anyone no a different blog post who deals with this topic? I am not very confident to implement this with collection variable myself, but I would love to have this implemented in my form.

Big thanks in advance!

fccrous
Nintex Newbie

I have thought of doing this so many times and sending reminders to users about all open tasks...but never started.  Thanks Dan... all the work is done  now I can just copy and implement.

Pyae
Nintex Newbie

Great to know the another concept to get the workflow history. Thanks for sharing this.

tenamatta
Nintex Newbie

Daniel Stoll

I am having an issue with this because the blog post says that the download file is a UDA.  But when I download it, it has a .nwf extension.  I have tried to upload it as both a UDA and import it as a workflow and get errors both times.  I don't know what I am doing wrong.  Please help!!

Thank you!!!