Jump to content
  • 0

Passing External Parameters


mackey
 Share

Question

I have two websites that are accessing the same set of data pages and tables on Caspio.  I currently have it set up that the user must select their region (East or West), then the data page is displayed for that region.  I'd like to set it up so that a region parameter is passed to Caspio from the website, so the user won't have to select their region.  I was hoping there was a way to pass the parameter from the Caspio provided embedded code.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi - Just wanted to share this solution. If you would like to get and display a field value/external parameter on an external HTML page, you can follow these steps:

1. Add an HTML code as a holder of the parameter, for example:

<span id="user"></span>

2. Insert a JavaScript, call and display the parameter in the holder.

<script>

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const userParam = urlParams.get('param');
document.getElementById("user").innerHTML = userParam;

</script>

The param is the name of the parameter from an external URL.

For reference: https://stackoverflow.com/questions/71727647/displaying-url-parameter-values-as-text-in-an-element-on-webpage-question-from

Link to comment
Share on other sites

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.

Guest
Answer this question...

×   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.

Loading...
 Share

×
×
  • Create New...