You are viewing limited content. For full access, please sign in.

Question

Question

Can the initiator send back to one of two user tasks based off previous step?

asked on April 5, 2022

We are trying to make changes to our salary pre-audit process.  

  1. HR submits and it routes to Budget
  2. Budget can return to HR for changes or approve and route to Finance
    1. Returned: HR can make changes and return to Budget or cancel request
    2. Approved: Finance can approve or return to HR as well for changes

 

Is it possible to use the same user task that goes back to HR/initiator for when budget or finance returns?  If so and without using different buttons, how would the system know whether the previous step came from Budget or Finance when the initiator has made the changes to be able to route back?  Do we have to use two different tasks for the initiator? 

SPAC capture.PNG
0 0

Replies

replied on April 5, 2022 Show version history

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:

  1. Add a custom HTML element with the following content:   {/_currentuser}
    and the following CSS Class Names:   getCurrentUser hiddenField
  2. Add a checkbox with a single Choice: Complete
    Make it required.
  3. 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.

0 0
replied on April 5, 2022

Thank you for your response.  This sort of makes sense.  Is it possible for you to share more info, or a test process where I can see all the moving parts?  Thanks!

0 0
replied on April 5, 2022

Was just finishing my edit when I saw this post.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.