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

Question

Question

single input - multiple outputs based on table

asked on May 25, 2017 Show version history

Using Forms 9.2

I have a process that requires a review of each part number on an order.  Because the review is very detailed, I would like to have 1 input form drive multiple outputs based off the number of part numbers listed in a table.

i.e. If 1 part number is listed, there would be only 1 output form and associated workflow within forms (simple).

But, if 5 part numbers were listed, there would be 5 output forms and associated workflow.

 

Can Forms handle this easily?  Would upgrade to Forms 10 provide additional functionality to handle this easier?

0 0

Replies

replied on May 25, 2017 Show version history

Can you clarify what you mean by output forms? Do you mean sequentially presenting the 5 follow-up forms to a user to review and click "Submit" on each one? Or do you mean save each of the 5 follow-up forms to the repository?

If you're trying to accomplish the first thing I mention, create a hidden single line "URL" field on your for and assign it the CSS class 'url'. Assign appropriate CSS classes to whatever fields you use in your lookup rules. 

Assuming your process is kicked off by a Message Start Event, you can setup the "Thank You Message" tab to redirect the user to another URL, instead of the Thank You Message. The URL in this case should be the value of whatever is in the hidden URL field on your form--ie, use a token (see below).

Then, you can modify the JavaScript snippet below to dynamically generate the URL of the "next" form in your set of output forms. This URL will populate your "URL" field. Once the final form in the set is submitted, the URL is set to some other website (your homepage, perhaps?) and a popup displays, thanking the user for submitting the forms. Uncomment the console.log lines if you like, for testing purposes.

$(document).ready(function() {
  var url = $('.url input').val(),
      yourField = $('.yourField2 input').val(),
      yourField2 = $('.yourField2 select').val(),
      urlAssignment = function() {
        yourField = $('.yourField input').val();
        // Remove 'x' anchors to delete table rows
        $('.action a').text('');
        // if statement checks for termination condition; your miles may vary
        if (yourField2 == '') {
          url = 'http://www.some.url.com/';  // After last form is submitted, user is redirected to this URL
          $('.url input').val(url);
          //console.log('variables initialized\nurl = ' + url + '\nyourField = ' + yourField + '\nyourField2 = ' + yourField2);     
        }
        else {
          url = 'http://111.111.111.11/Forms/YourFormNameGoesHere?Some_Variable=Some_Value&Your_Field='
          + encodeURIComponent(yourField) + '&Your_Field_2=' + encodeURIComponent(yourField);
          $('.url input').val(url);
          //console.log('variables initialized\nurl = ' + url + '\nyourField = ' + yourField + '\nyourField2 = ' + yourField2);
        }
      };
  
  // Remove "Add" anchor below table
  $('.hideAddRow').text('');
  
  $('.yourField2 select').change(function() {
    yourField2 = $(this).val();
    //console.log('yourField3 changed to ' + yourField3);
  });
  
  $('.yourField input').on('change', function() {
    setTimeout(urlAssignment, 250);
  });
    
  // Prevents display of popup message until last form is submitted with a signature (remove everything between the second single quote and the closing parenthesis if you don't need this)
  $('.Submit').click(function() {
    if (yourField2 != '' && $('.Sign_Sig').css('display') == 'none') {
      alert('Thank you message goes here plus whatever field values (ie, ' + yourField + ' you like.');
    }
  });

  setTimeout(urlAssignment, 250);
  
});

Sorry if all this is TMI--if it's not, I'm happy to answer any questions you might have.

0 0
replied on May 25, 2017

Rob, Thanks for going through the effort!

You are correct with the former option.  I want to enter 1 form, with a list on it, and generate 5 separate forms that will go for review.

 

I don't have much experience with the CSS or JavaScripting, but I will give it a try.

0 0
replied on May 25, 2017

Great! Don't hesitate to reach out--I just implemented this on a project I'm working on so everything is fresh. If you need more help or clarification on anything, post screenshots of your lookup rules and form(s) and I'll be better able to assist.

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

Sign in to reply to this post.