cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Labels: (2)
Tags (2)
Reply
7 Replies
Not applicable

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Matt,

Under the Task Action Configuration, based on whether the task is assigned to a group or a individual , task configuration has option to
Store task ID(s) in a workflow variable type integer or collection.

Hope this helps

0 Kudos
Reply
Not applicable

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Hi Vamsi,

It is great that i can get the task ID from the approval task action, because then i can build a URL to that task form. However, my problem is that the workflow is holding at the task approval process. Thus i cannot use the workflow to perform other actions in the mean time.

My overall goal is to put a link on my form to the approval task. Even though the approver will get an email with the link to the task, i am trying to add a link on the form that goes to the open approval task. I was hoping to build a URL with the task ID.

any ideas?

0 Kudos
Reply
Not applicable

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Matt,

I would recommend against it, as you have to check the task is complete and then hide the link etc.. Designing Nintex Workflows and Forms is different from designing forms using InfoPath(regular SharePoint). Nintex recommends keeping the list forms as simple as possible, and designing a form per task promoting separation of Process logic from Presentation. Forms are part of the workflow minimizing the effort required to keep the list form in sync with the workflow steps.

I suggest you to check out the Flexi task and create a custom form for this approval task, the flexi task form allows you to display and edit columns of the list item on which the task is created and also choose the outcome ( Approval / Rejection ..etc)

But if you still feel that you have to show the task url on the mail form then workflow variables can be accessed in Nintex forms, so check for no null and form the link using calculated field.

Hope this helps

0 Kudos
Reply
trien
Nintex Newbie

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Hi Matt

I needed to do something similar as well.  Our users wanted to be able to go to the approval task either directly from the form, or from viewing the list of outstanding forms.  Many do not like to use the emails and sometimes due to the volume, some emails get lost or ignored.  Either way, it's the users who drive the use and if you don't make it the way they want to use it then eventually it will be abandoned.

Here's my method to add a link to approval task directly on the form:

  • In your workflow, you'll need to configure the task so that each task will have a unique name.  I just appended the Item ID and the item Title to the end.  Keep this name short because I've found that lookups stop working when it's too big.  Mine was called Task{ID}{Title}.
  • On your form, add a Calculated Value field with the formula lookup("Workflow Tasks","Title","Task"+{ID}+{Title},"ID").  Replace the list name and lookup value to yours.  In Advanced, enable Store Client ID in JavaScript variable, and give it a variable name.  I used TaskIDValue.
  • On your form, add a Button.  Configure it as action JavaScript, and Client Click of OpenTask().  i wanted this button to work even when approvers were viewing the form, so I turned on Visible when in view mode, and also Enable when in view mode.
  • On your form settings, under Custon Javascript, add the following function:
    function OpenTask()
    {
    var taskID = NwF$('#'+TaskIDValue).val();
    window.location="http://yourdomain.com/sites/sitename/lists/workflow%20tasks/editform.aspx?ID="+taskID;
    }

Those are all the parts that should get you going.  You can clean up the user experience by adding some rules to the calculated value and button fields to hide when it's not an approver, or once the task is complete.  Note this method may need to be tweaked if your approval task creates multiple task items.  It assumes one task item is created.

Hope this helps.

0 Kudos
Reply
Not applicable

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Hi Trien,

 

Thanks for the great suggestion. I was able to accomplish adding a link to the approval task directly on the form by the following steps

 

These steps take place on the TASK LIST:

  • When NWF creates an approval task, it creates a Item Property on the task called "Workflow Item ID." (which is the ID number of the item of which the NWF is running against)
  • Set field Value Action relatedItemID = Workflow Item ID
  • Set variable Action varFormID = List Lookup, Source: Current Item, Field: relatedItemID
  • Build String Action http://domain.com/sites/site/list/list-name/EditForm.aspx?ID={ItemProperty:ID} Set to varEditURL
  • Update Item Action
    • What to Update: FORM LIST
    • Where: ID = varFormID
    • Update Field: Approval URL = varEditURL

 

At this point I have a Field on my form that contains a link to the Edit Task URL. I then use JavaScript to display that URL on the Display Form.

 

I am sorry to say on this forum that i do not use Nintex Forms, but would like to illustrate that NWF can be used with Other Form Tools.

 

Thanks for the help

-Matt

Reply
razvanhr
Nintex Newbie

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Hey, I've got a pretty similar requirement and I've been able to use this approach successfully. I've just used the SiteURL variable to build parts of the Task Edit Form URL. In my case however I have a number of parallel tasks, so that I have to use the lookup() function with 5 parameters / just set true for the 5th parameter so that an array is returned instead of one value.

0 Kudos
Reply
kroman
Nintex Newbie

Re: How can i get the URL or Item ID of an approval task into the scope of the parent form or workflow?

Hi

Where would I find "Task Action Configuration"? (I am on sharepoint 2013 online)

Thanks

0 Kudos
Reply