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

Question

Question

Percentage of Form sent for Approval

asked on February 18, 2022 Show version history

I have a form that has a approval step in which they want on a percentage of forms sent to this step for quality assurance.  Is there a way to direct only a certain percentage of forms to this step?

0 0

Answer

SELECTED ANSWER
replied on February 18, 2022 Show version history

You would likely need to include a Workflow in order to generate a random number to use for determining which ones to route.

Let's say you want 10% of them to go to this step.

Using Workflow, generate a random number between 1 and 100 and store it into a field in Forms (hide the field on all forms using CSS or Field Rules).

Then in Forms, use a Gateway to select the "review" path if the random number field is less than or equal to 10.

Also, please consider editing your post and changing it from a Discussion to a Question so that once you have your preferred response, you can mark is as answered.

0 0
replied on March 9, 2022

Thank you.  How do you get WF to generate the number?

0 0
replied on March 10, 2022

I do it via an SDK Script activity.

Set the activity to use C#.NET.

Add this script into the Execute() function:

            //generate a random number between 1 and 100 and return it to workflow as a token
            Random rand = new Random();
            int number = rand.Next(1, 101);
            SetToken("RandomNumber", number);

The activity will return a token named RandomNumber that will contain the randomly generated number between 1 and 100.

0 0

Replies

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

Sign in to reply to this post.