Hyperlink to Edit item in SharePoint using Nintex for Office 365

Business case:

Users want direct link to Edit Item from their notification email body without having to go to the form ribbon and then clicking on Edit Item as seen below.

EditItemURL1.png

Solution:

Say you have ‘Send an Email’ action in the Nintex workflow with the text below.

U‍RL of the current item: {Workflow Context:Current item URL}‍

This would email selected user with the URL of the current item from Workflow Context. Clicking on that will then redirect users to

Actual URL of the Nintex form in DISPLAY mode:

https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp/NFLaunch.aspxSPAppWebUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp&SPHostUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite&remoteAppUrl=https://formso365.nintex.com&ctype=0x0100B52DC7B8A6EC4040BAB784010BB614F9&wtg
=/sites/Forms/Swetha/TestSite/Lists/EmployeePromotions/Item/&mode=2&List=6aa1b4ba-ca60-4434-93d6-f4146d026075&ID=6&Web=f8661cf5-7a18-430f-9f92-262850e0087d

 

URL of the Nintex form in EDIT mode:

https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp/NFLaunch.aspxSPAppWebUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp&SPHostUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite&remoteAppUrl=https://formso365.nintex.com&ctype=0x0100B52DC7B8A6EC4040BAB784010BB614F9&wtg=/sites/Forms/Swetha/TestSite/Lists/EmployeePromotions/Item/&mode=1&List=6aa1b4ba-ca60-4434-93d6-f4146d026075&ID=6&Web=f8661cf5-7a18-430f-9f92-262850e0087d

 

Splitting the URL string for EDIT item as seen below:

Line 1: https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp/NFLaunch.aspx?PAppWebUrl
Line 2: =https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp&SPHostUrl
Line 3: =https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite&remoteAppUrl
Line 4: =https://formso365.nintex.com&ctype=0x0100B52DC7B8A6EC4040BAB784010BB614F9&wtg
Line 5: =/sites/Forms/Swetha/TestSite/Lists/EmployeePromotions/Item/&mode=1&List=6aa1b4ba-ca60-4434-93d6-f4146d026075&ID=6
Line 6: &Web=f8661cf5-7a18-430f-9f92-262850e0087d

We can see that mode=1 opens the item in Edit Mode for that particular item ID which we can get dynamically from Current item ID.

To get dynamic link for Edit item in Nintex workflow for office:

Use Nintex Build String Action output to a single variable called varEditURLTxt

1) Open the item in EDIT mode and copy the URL of the item.

2) Get everything in the EDIT URL until ‘&ID=’

2) Insert reference to current item ID

3) Add the remaining portion of the EDIT URL(Line 6 above)

Now this string variable contains the dynamic URL which can inturn be included as hyperlink in email body of ‘Send an Email’ action. When the users click on the hyperlink generated, they will be redirected to ‘Edit item’ form instead of display.

Final URL:

https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp/NFLaunch.aspx?SPAppWebUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite/FormsApp&SPHostUrl=https://yourtenant.sharepoint.com/sites/Forms/Swetha/TestSite&remoteAppUrl=https://formso365.nintex.com&ctype=0x0100B52DC7B8A6EC4040BAB784010BB614F9&wtg=/sites/Forms/Swetha/TestSite/Lists/EmployeePromotions/Item/&mode=1&List=6aa1b4ba-ca60-4434-93d6-f4146d026075&ID=‍{Current Item:ID}‍&Web=f8661cf5-7a18-430f-9f92-262850e0087d

EditItemURL2.png

 

While this post talks about the SharePoint master list item and its link to edit form, you can do this same exact set of steps for allowing your users to open the Workflow Task items in Edit mode as well with a quick hyperlink.

Once again with dynamic ‘Build string’ action. Provided you have a ‘Assign a task’ action where you have managed to capture TaskID, and want to provide a quick edit link to the ‘next’ approver, to do the above

1) Get the ID of the task item (taskID – GUID variable value and ‘Advanced Lookup’ to ‘Workflow Task’ List to get the ID)

2) ‘Do Calculation’ to get  the task’s ID ‘plus’ 1

3) Build the string doing the same steps as above from the Edit workflow task Item link.

This logic for task item edit hyperlink will ONLY work if it is the second task in the sequential/ serial workflow…that was my requirement, if I have any others in future, will post another blog! In the meantime, feel free to share your workarounds!

Good luck!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s