Solved

How to pull task URL and update list item with it

  • 8 December 2017
  • 16 replies
  • 688 views

Badge +3

Within a workflow, I would like to pull the Task URL and update the list item with it. I can't see an easy/clean way to do this. Ideally, I would end up with a list column titled Task URL and 'Link' listed for each item. The link would direct the user to the task form to be filled out. Trying to avoid email. 

 

Thanks. 

icon

Best answer by cdsommerfield 11 December 2017, 16:27

View original

16 replies

Userlevel 3
Badge +12

Hi Brittany,

I also had similar requirement, but I don't see a way to achieve this.

Thanks,

Krishna.

Badge +9

I know for sure you can do this in On Prem, not 100% sure you can with o365... but you just need to store the task ID into a variable when you create the task. Then use a build string to create the URL

https://sharepoint.com/sites/testsite/Lists/Workflow%20Tasks/EditForm.aspx?ID={TaskIDVariable} , Link

The update list item action.

If you need something more detailed, let me know and I can document it.

Badge +9

Went ahead and did it anyways for ya! Because I was curious myself! Works like a charm.

In your target list, create a Hyperlink column and name it whatever you'd like.

Create an int variable for the Task ID (This is at the bottom of the Assign a Task Action

Create a build string action and use the static URL to tasks on the task list.

Change "Workflow%20Tasks" if you've renamed it to something else, but that one is default. Set the ID = to the name of the variable above. Add a "," after and whatever you put next will be the name of the link

Use a "Create List Item" Or an "Update List item" action to write the URL (varTaskLink above) to the target list

Target list now has URL to task

Badge +3

I'm beyond excited to try this - thanks for the response!

One question.. where in the workflow do I put the Build String action? If I put it after the Assign Task, will it only execute if the task is completed? 

Badge +9

You have to uncheck "Wait for task completion" then add it after

If you need it to stop, you can always add a condition, wait until, or filter after it.

Badge +3

Ahh got it. So if I needed to have actions execute based on the task outcome, I would just add conditions? If approved, send email, update list item, etc etc. 

Badge +9

Correct! Speaking of correct, can you mark my answer as correct when you get a chance? :-p

Any other questions, let me know!

Badge +3

It worked beautifully after the task executed. When I switched it to 'wait for task completion, I'm getting this error when trying to publish: Error publishing workflow. TypeConverter cannot convert from System.String.

I think it's because I'm trying to pull the Task Outcome.. maybe. I have the assign task action, then the build string/update list item actions. Then trying to grab the task outcome and put it in a variable.. but I think I am doing that wrong. From there a bunch of conditional branches depending on the task outcome.  

Badge +9

That error seems like you may be using the wrong variable type for something. When you save the build string and put it in a variable, make sure it's text. The TaskID should be Integer. If you want to capture the outcome, you'll need to query the task list. that can be done by using the Task ID that you stored from Assigning the task. query the task list, add a filter where ID=varTaskID then the column you want is one of the "Nintex Task Outcomes" that have guids behind them.

Badge +3

Last issue.. and you have been SO helpful.. my workflow is functioning correctly up to the query part. When I query the list, I created it as the variable TaskOutcome. I then created an action to update the list item with the variable. It is writing it as [{"Nintex_x0020_Task_x0020_Outcomes0":"Approved"}] or [{"Nintex_x0020_Task_x0020_Outcomes0":"Rejected"}]. Is there a way to not write as a string? I see on the Workflow Task list it displays it correctly... "Approved" or "Rejected". 

Thanks again. 

Badge +9

Are you using a Collection variable for them or a Text variable? Text should just return "Rejected" Or "Approved"

Userlevel 2
Badge +9

Thank you for this @cdsommerfield.  I had a similar requirement.  My need was to setup a notification for someone to complete an assigned review.  Since those don't have the built in reminders like approvals do, I have people who essentially ignore them.  I will now design my nag-a-gram using this method.  (insert evil laugh here).

Badge +9

@brianknight Glad older posts are still helping out users! Have fun :-p

Badge

Hi @cdsommerfield 


Where do I look for to uncheck the "Wait for task completion"? I can not find that setting. I am using the "Assign Flexi Task" of the Nintex Workflows 2013.


 


Thank


You

Badge +9

@Gentille 


 


Hey! So the above information is related to the O365 version of Nintex. For NWF 2013, you would store your task ID at the bottom of the flexi task action. In "Store task IDs in". If the task is only being sent to one person you can use the "List Item ID" variable. If the task is sent to multiple people, you'll need to put the task IDs in a collection variable.

@cdsommerfield - I am hoping there is a solution for this in flexitask. I've seen your updates and have built the string with updated instructions. I don't see how I can allow it to build the string and put it in the list before the task has been completed. I'm using flexitask, it has three branches of options. 

Reply