Jump to content
  • 0

Accessing External Data


egilley

Question

I am trying to show graphics in a Submission Form, based on specific data, and so i'm inserting HTML block with "if" JS's...

 

They work perfectly when the data is already saved in the current table.  I'm using:

var cb_punchin = '[@field:L1_time_in]';

 

But that doesn't work if the data is coming in from another page into a hidden field in my submission form.  That data hasn't been saved in the current table yet.

 

Is there a way to access saved data from a different table?

Or a way to grab the data from the external data coming in?

 

I'm learning JS in little bites... help with this would be very much appreciated.

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello, 

Just to add in the previous comment, you can use a Select Statement in a Calculated value to get information from the other table. https://howto.caspio.com/datapages/datapage-components/calculated-values/

As per MayMusic's suggestion, you should receive the field as [@L1_time_in]. It means that it is a parameter. Make sure that you also pass the value from the other DataPage. 

https://howto.caspio.com/parameters/parameters/

Link to comment
Share on other sites

  • 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...
×
×
  • Create New...