Hey 115990709251, I just tested importing from CSV using the hyperlink as the matching field, and it did match on the actual URL rather than the Text, so you shouldn't have any problems using the 'use the same text for all links' option with this.
14442759487 is this still possible with a link field? While I know this option exists in the builder, if enabled, it doesn't allow link matching when you upload a CSV. I like the link to stay the link as the record, but when you view the page use JS to replace the URL with "Link". Is this doable?
Thanks for the quick response. I just plugged this in and it works perfectly. With my mediocre JS skills, there is no way I would have figured this out quickly (if at all) so much appreciation for sharing as I think this streamlines/improves the UX for file downloads out of Knack. Thanks again!
You're in luck! I wrote this code a little while ago, hopefully it still works. This will automatically display a PDF/image file or start downloading any other file once clicked, rather than display in the preview window. All you need to do is replace {YOUR APPLICATION ID} with your app's ID.
$(document).on('knack-scene-render.any', function (event, view, data) { $("a.kn-view-asset").on("click", function(e) { e.preventDefault(); //Prevent normal file window opening e.stopPropagation(); var url = $(this).attr('href'); // Get the URL of the clicked link var pathArray = url.split('/'); // Split the URL string into substrings between '/' characters var filePath = pathArray[pathArray.length-1]; // Get the file name in the last substring (e.g. file.pdf) var assetPath = pathArray[pathArray.length-2]; // Get the asset path in the second-last substring (e.g. 6-13-77-5d2ffb2f47b3c70010ffd98d) pathArray = assetPath.split('-'); // Split the assetPath into substrings between '-' characters assetPath = pathArray[pathArray.length-1]; // Get the actual asset path in the last substring (e.g. 5d2ffb2f47b3c70010ffd98d) var newURL = "https://api.knack.com/v1/applications/{YOUR APPLICATION ID}/download/asset/" + assetPath + "/" + filePath // Concatenate the download URL window.open(newURL, '_blank'); // Open the new URL in a new tab }); });
Thanks - super helpful for view/table formatting. One semi-related question. When a user clicks on one of these file links to access/download, a modal pops up with the download link somewhat buried at the bottom. Does anyone know how to change this behavior so that when a file link is clicked on, the file simply downloads right away without popping up the modal?
Hi Team, I use zapier to create a folder structure for a new client in Google Drive and create a link in the Customer Record for each folder for easy access to the created folder. Is there any way to change the long Google Drive Folder name to a simpler one as you do with a file name in you post above?
It converted it into an icon nicely, but when left-clicking on the icon, it didn't open up the attachment. Right-clicking and opening in a new tab however seemed to work.
This works great within the app, but is there a way to get Knack to do this when it generates an e-mail? So the file name doesn't show but just some generic text?