Hey, I am using a query wont dump all the code here but within the code I have a property and value which will serve as a link, by altering the dataPath.
can't find the video you did this on but along the lines of ,
tableRows.forEach((row) => {
row.download = 'Download';
row.video = '▶️ Video';
$w("#Tab1").rows = myResults.items;
Later in the code, add colum?:
"id": "col3",
"dataPath": "download",
"label": " Download",
"visible": true,
"type": "richText",
"width": 130,
"linkPath": "caiDocument"
}, {
"id": "col4",
"dataPath": "video",
"label": "",
"visible": true,
"type": "richText",
"width": 90,
"linkPath": "VideoLink"
}];
...etc. Works fine and the link reacts as expected. Everything works just find until their is no link for it to use. It still shows the set text 'Download'.
How would I ignore this rule if there is no link in the database?? In other words I want it to populate the text only when a link is available, for example download & video links. if download has a link and video has not, I want the table to only show download and not video. at the moment I messed with richText and is sort of sorts if i add the correct link to the text itself, then the link highlights as expected but completely goes against what I am trying to achieve.
Its a customer portal where they add a code and its gets the right installation document without exposing other versions, some instruction have videos and some dont. I dont want everyone to think there is a video when their is not, also to avoid confusion to if their should be one, having the text pop up indicates it should and is missing, not always the case. here is the site www.bytechealth.com/portal-cai , here are some passcodes - V10F / 1212 / DKCK / PSAG/ HB4B.
Hi Ben,
I think a condition in the table row setup should do the trick.
Assuming "myResults" is the result of the data query and the link to the download is stored in the 'download' field:
const documents = myResults.items; for(let i = 0; i< documents.length; i++){ row[i].download = documents[i].download? 'Download': ''; //same logic for video } $w("#Tab1").rows = myResults.documents;
Please let me know if you have any luck.
Eitan