I have lots of different processes where the return to initiator step returns to a single task.
If you are wanting the process to proceed through all the same steps after it is resubmitted, then it's easy. But if you want to be able to have the submission from that return to initiator step to return to different parts of the process, then you would need to include some value to tell your process where to return to.
I usually do this with a field that populates some value when the approver completes their approval. If that field is complete, then I know I don't need to repeat that approval step. If it is not complete, then I know I need to do the approval step again.
Personally, I like to do approvals via a checkbox with some javascript that will populate a text field next to it with the user's name and the timestamp. The checkbox is required, so they cannot submit or approve the form without completing it, but I add Javascript to remove the requirement if they reject the form, allowing them to return to initiator without completing the checkbox. Then you just evaluate whether the specific approval timestamps are complete when determining whether or not to repeat that task.
EDIT TO ADD SCRIPT:
This example needs three fields to work:
- Add a custom HTML element with the following content: {/_currentuser}
and the following CSS Class Names: getCurrentUser hiddenField
- Add a checkbox with a single Choice: Complete
Make it required.
- After the checkbox, add a single line field with Medium width (do not make readonly)
and the following CSS Class Names: completionStamp twoThirdWidth
With multiple approval stages from different teams, repeat steps #2 and #3 for each approval you want to gather. Make the checkboxes that are not from the current approver readonly and not required and only the current approver's checkbox is editable and required.
Here's the CSS:
.hiddenField {display: none!important;}
.thirdWidth {display : inline-block; width : 33%;}
.twoThirdWidth {display : inline-block; width : 67%;}
Here's the Javascript:
//this section processes when the form has finished loading
$(document).ready(function () {
//Make all of the completionStamp fields read-only - need to do this via Javascript
//so that values populated in Javascript are saved
$('.completionStamp input').each(function() {
$(this).attr('readonly', 'true');
}); //end of $('.completionStamp input').each(function() {
//These steps are completed when a completionCheckbox field is changed. The
//completionStamp field is populated with the current user's username and full name.
$('.completionCheckbox input').change(function(){
var today = new Date();
var date = today.getFullYear() + '/' + ('0' + (today.getMonth() + 1)).slice(-2) + '/' + ('0' + today.getDate()).slice(-2);
var time = ('0' + today.getHours()).slice(-2) + ":" + ('0' + today.getMinutes()).slice(-2) + ":" + ('0' + today.getSeconds()).slice(-2);
$(this).closest('li').nextAll('.completionStamp').first().find('input').val($('.getCurrentUser').text() + ' ' + date + ' ' + time);
});
//Remove required fields when the Reject button is clicked, allowing
//incomplete form to be rejected.
$(".action-btn.Reject").on('click', function() {
$('*[required]').each(function() {
$(this).removeClass('required')
$(this).removeAttr('required');
});
}); //end of $(".action-btn.Reject").on('click', function() {
}); //end of $(document).ready(function () {
The result is that in each approval stage there is a checkbox for them to mark that automatically populates a field with name and timestamp. That checkbox may be the only thing they need to complete, so it shouldn't feel like asking too much of a user. The checkboxes and timestamps can easily be shown as read only in all parts of the form, so everyone involved knows who and when approvals happened, and the timestamp can also be tested by the system as empty or not empty in order to evaluate whether to take a particular gateway path and assign a task to the user.