Jump to content

Redirect on Submit

Recommended Posts

I am trying to create a custom Redirect in my DataPage.

First off, I have a dropdown which the user will select the value from. If the user select A then he should be redirected to DataPage X, if the user select B then redirect to DataPage Y, if the user selected option C then should be redirected to DataPage Z.


If (dropdown.option =='A') {


    elseif (dropdown.option == 'B') {


    elseif (dropdown.option == 'C') {



else {return 'Invalid';}




Link to comment
Share on other sites

Hi @Perzival

This can be achieved using JavaScript. You may just want to use Switch method on that. Here's an article: https://www.w3schools.com/js/js_switch.asp

Switch method example:


document.addEventListener('FormSubmitted', function(event) {

switch (document.getElementByClassName('cbFormSelect').value); {
  case A:
  case B:
  case C:

Note: If you are using a field that is created from the table then make sure to save your URL's in that particular field. If you're using a Virtual field, you may enable custom values and insert your URL's in that field.


You should pass the field's parameter on exit then choose "go to another page" at the last part of submission. From the URL field, paste the parameter and hit finish.



~ H

Link to comment
Share on other sites

  • 2 years later...
  • 7 months later...

Use Javascript:


It’s better than using window.location.href = ‘http://example.com’;

Using replace() is better for javascript redirect because it does not keep the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco.

If you want to simulate someone clicking on a link, use window.location.href

If you want to simulate an HTTP redirect, use window.location.replace

You can use assign() and replace methods also to javascript redirect to other pages like the following:


The difference between replace() method and assign() method(), is that replace() removes the URL of the current document from the document history, means it is not possible to use the “back” button to navigate back to the original document. So Use the assign() method if you want to load a new document, andwant to give the option to navigate back to the original document.


Link to comment
Share on other sites

  • 1 month later...

Hi - Just an update, you may now use Virtual Field and Calculated Value on this workflow.

You may use a Virtual Field as a holder or identifier of the value from the dropdown and then set the Form Element as Calculated Value. In the Formula, you may use a CASE WHEN statement like:

THEN 'https://www.google.com/'
WHEN [@FIELDNAME] = 'value 1'
THEN 'https://caspio.com/'

After setting up the formula, on the Destination and Messaging configuration screen, set the Destination after the record submits to 'Go to a New Page'. Lastly, in the Page URL, call the Virtual Field from the field picker.

For reference, you may check these links:

https://howto.caspio.com/datapages/forms/submission-forms/#:~:text=to make conditional.-,Destination and Emails,-Here you can

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...