Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Clickable URL field in portal list view

VigneshMC
Mega Sage

I would like to show a field with clickable hyperlink in portal list view for a table to users . Even OOB URL field is not rendered as hyperlink in list view .

 

There are multiple solutions for native UI but looking for any inputs to make it work in portal

Thanks

4 REPLIES 4

Rajesh Chopade1
Mega Sage

Hi @VigneshMC 

 

I hope following link will helpful for you:

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0683847 

 

Thank you

Rajesh.

Hi Rajesh , I am looking for options where in one of the fields from a table rendered in OOB widget will have URL which is clickable

Hi Vignesh, have you got the solution. I am also having the same requirement.

Hi @jatin24j242424 & @VigneshMC 

To display a clickable hyperlink in a portal list view, you can customize the Service Portal widgets or use a combination of a field decorator and custom HTML.

 

Create new widget:

function($scope, $http) {
    // Fetch data from the table (replace 'your_table' with the actual table name)
    var gr = new GlideRecord('your_table');
    gr.query();
    var records = [];
    while (gr.next()) {
        records.push({
            // Replace 'url_field' with your actual URL field name
            url: gr.url_field.toString(),
            display_field: gr.display_field.toString() // The field you want to display as a hyperlink
        });
    }
    $scope.records = records;
}

 

HTML

<div>
    <ul>
        <li ng-repeat="record in records">
            <!-- Display the hyperlink -->
            <a href="{{record.url}}" target="_blank">{{record.display_field}}</a>
        </li>
    </ul>
</div>

 

You can embed this widget into any Service Portal page where you want the clickable URLs to be displayed.

 

i hope my answer helps you to resolve your issue, if yes please mark my answer helpful and correct.

thank you

rajesh