Skip to main content

I have created a workflow that copies an item within the same list.  Due to some requirements, I used the 'Create Item' workflow action to duplicate the item and have the new item ID stored in a workflow variable.  How can I configure the workflow to end by opening the copied/duplicate item on Edit mode?

Hi there

I'm not sure I understand.. let me see..

1) Your workflow copies an item to the same list.

2) Your workflow is set to run when a new item is created in that list.

3) When the workflow runs on the new item that's added, it creates the duplicate, and stores the ID of that duplicate as a WF variable.

Is it a need to have that WF end on opening the duplicate item? Or is your need that you don't want the WF to run on the duplicate item?

If the prior, can you explain that requirement a bit more? Not sure I understand why the WF would end then, and not just when it had completed the task of creating that secondary item. Do you require keeping that duplicate's variable?

Cheers,

Rhia


The workflow is configured to start manually.

What I have right now in the workflow is a "Create an item" in list that basically creates a duplicate of the item that the workflow is running on.  The ID of the new item is stored in a workflow variable.  Basically, I want the workflow to redirect the user to the Edit form of the new item at the end instead of going back to the list view.  Is this possible?  So yes, the need is to have the WF end on opening the duplicate item in Edit mode.  How do I do that?


You can use the workflow start form in the workflow setting

200466_pastedImage_1.png

Customize the form to have an OK or submit button , and use javascript on the OK or Submit button to redirect to the edit form. {WebURL}EditForm.aspx?ID=varNewItemid.


The 'Edit Start Form' button is disabled on my environment.  We don't have Nintex Forms, just Nintex Workflow.

Also, I had set up the workflow to start automatically from the user action menu item without having to go to the 'Start Workflow' page before starting the workflow.


Hi Wiewiek‌,

Since Nintex Form is not used Edit Start Form button will be disabled.

This is what I understand your scenario is:

When you select the option to trigger the workflow from the ECB Menu (as shown below) you will be redirected to your StartWorkflow.aspx page, and on click on Start button workflow will be triggered to duplicate the item on which workflow was triggered. Later redirected to the SharePoint list from where you made the ECB Menu selection. 

Reason : If you notice the URL when you view StartWorkflow.aspx page will be some thing like this 

http://<<Site URL>>/_layouts/15/NintexWorkflow/StartWorkflow.aspx?List=%7B4E0D369D%2D8F8A%2D42C5%2DBF89%2D02C486BA1389%7D&ID=2&TemplateID=d6a8a106-b7e2-46c9-a359-08e152cd5235&Source=http%3A%2F%2F<<Site URL>>%2FLists%2F<<List Name>>%2FAllItems%2Easpx

The Source query string hold the URL from where it came from to StartWorkflow.aspx page, and it is to this URL it will redirect after performing the action in the current page i.e. StartWorkflow.aspx page.

What you are expecting is to modify the &Source link each time, which is tough (or say not possible):

http://<<Site URL>>/_layouts/15/NintexWorkflow/StartWorkflow.aspx?List=<<List GUID>>&ID=<<item id on which you wish to trigger the workflow>>&TemplateID=<<template id>>&Source=http://http://<<Site URL>>/Lists/<<List Name>>/EditForm.aspx?ID=<<item ID that you want to view in edit mode after workflow trigger>>

Try replacing the Source paramter when you are in StartWorkflow.aspx page as shown in above link; it will work as expected when its hard coded.

200558_pastedImage_2.png

200559_pastedImage_3.png


Chaitra, that is a good suggestion!  Unfortunately, it won't work in my case as the ID will be dynamic for each workflow execution.


Yes, it would not work as mentioned earlier. Nor there is another way around this requirement. 


Hi Wiewiek,

Without the nintexforms‌ redirect function I don't think this will be possible. Alternatively you can send an email to the user with the {WebURL}EditForm.aspx?ID=varNewItemid link in the email body. 


Reply