Jump to content
  • 0

Hyperlink in a calculated field


KAPITYAN
 Share

Question

2 answers to this question

Recommended Posts

  • 0

Hello, @NJConrcs.

 

I tested something which seems to be a viable solution.

Turns out you can actually use your calculated field in an HTML block. (See image)

The default formatting for Calculated Field is Integer, you might want to double check if you want the returned value as a String. After then, you may be able to use that as a hyperlink.

Screenshot_2.png.424b41e23f73c7db0a22c88b6ee2d9de.png

 

Regards,

DN31337

Link to comment
Share on other sites

  • 0

I just want to add something, though it's a bit off topic.

 

In the solution I provided above, it seems that there's no way we can hide the Calculated Field within the standard features of Caspio.

(see sample result below).

res.thumb.png.ba50b6c17b142833941f6644d05c5aa0.png

 

I just presumed that there are some cases where we might want to hide that Calculated Field.

As far as I have investigated, there are no current features of Caspio that can do that so I'll just present some CSS workaround to hide that Calculated Field.

Do the following:

1.) Add a header and footer

2.) Click on footer, disable HTML Editor in the Advanced tab; then

3.) Paste the code below and set the calc field index to correspond with the position of your Calculated Field (in my case, 3)

 

<script>

// Column Index
var CalcFieldIndex = 3;

/* Sample usage (asterisks* not included):
*
*	var CalcFieldIndex = 2;
*
*	var CalcFieldIndex = 4;
*
*	var CalcFieldIndex = 7;
*/


// Do not edit syntax from this point onward!!!

  // Select the fields in nth column
  var ff = document.querySelectorAll("table[id*='cbTable'] tr th:nth-child("+ CalcFieldIndex +"), table[id*='cbTable'] tr td:nth-child("+ CalcFieldIndex +")");

  // Give 1 second delay to remind devs that we have JS code
  setTimeout(function(){

    //Hide the fields on nth column
    ff.forEach( function(elem) {
      elem.style.display = "none";
    });

  }, 1000);

</script>

 

I really hope this helps.

DN31337

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