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

Question

Question

Any way to set a Form variable with workflow *before* the user sees the thank you page?

asked on March 4, 2020

We have a form that will be accessed by public (anonymous) users.

When they click submit, we want to kick off a workflow, which will run some business logic to create a Redirect URL with some special query parameters. (We cannot run this logic on the form itself because it's proprietary and cannot be exposed to public users.)

We want to pass this Redirect URL created by Workflow back to the form BP and use it to redirect the user.

Is this possible?

For a logged in user, we would simply use a User Task and some JavaScript magic. But I'm trying to see if it's doable for anonymous users as well.

0 0

Answer

SELECTED ANSWER
replied on March 4, 2020

There's no real graceful way to do this, but you could make it work.

You could have a hidden field specifically for tracking this form on submission. There are multiple ways to track it, but let's just go with this... Create a hidden field and populate it with a guid. Redirect the user to another form with the guid in the query string. Have javascript display a Loading progress bar or model or something until you have the data available in SQL. Keep retriggering lookup values until you have a match from that guid. 

In the mean time, have workflow do the web request, then dump the results into a SQL table that you're doing a lookup from in the other form.

Once your lookup rule match the guid to the SQL entry and fills a cell, use Javascript to redirect to that URL.

0 0

Replies

replied on March 4, 2020

Lookup rules and stored procedures come to mind. More information about what information you'd be using to construct the URL would be necessary to help further. 

If you needed to do some logic, and you could do it in SQL, you could trigger a stored procedure to fill a hidden field. You could then use that hidden field for the On Event Completion - Redirect to website feature.

0 0
replied on March 4, 2020

The redirect URL is actually created by a third-party service, which Workflow will be calling via a web request. That's why we can't use a stored procedure for this.

Basically, workflow needs to take the submitted form data, send it to the third party service, get the redirect URL in the response and send that back to the Forms instance, which should redirect the user to that URL.

0 0
SELECTED ANSWER
replied on March 4, 2020

There's no real graceful way to do this, but you could make it work.

You could have a hidden field specifically for tracking this form on submission. There are multiple ways to track it, but let's just go with this... Create a hidden field and populate it with a guid. Redirect the user to another form with the guid in the query string. Have javascript display a Loading progress bar or model or something until you have the data available in SQL. Keep retriggering lookup values until you have a match from that guid. 

In the mean time, have workflow do the web request, then dump the results into a SQL table that you're doing a lookup from in the other form.

Once your lookup rule match the guid to the SQL entry and fills a cell, use Javascript to redirect to that URL.

0 0
replied on March 5, 2020

Yeah, this works. You're right, it's not graceful, but I'll take it. smiley

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

Sign in to reply to this post.