Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Change hyperlink on Entity filed as link

(0) ShareShare
ReportReport
Posted on by 15

Hi,

On my portal page I have two columns as shown below:

pastedimage1592379670000v1.png

 The Address fields are clickable and working fine. Is it possible to just show a link instead of full URL ( For example http://www.bing.com should only show clickable text as "Bing"). Or if I can make "SearchEngine" column values as clickable for given hyperlinks. 

I tried few Javascripts on Entity List, but none is working for this kind of scenerio.

  • Vkas Profile Picture
    15 on at
    RE: Change hyperlink on Entity filed as link

    Hi Clofly,

    As I checked the solution in few scenarios, I found all working fine.

    Thanks a lot for helping me on this.

    You can now marked this as answered.

    Thanks

  • cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi VKas,

    Have you also gotten success by CSS solution?

    Regards,

    Clofly

    Please kindly mark as verified to close the thread if you had found any answer helped, it would be really appreciated.

  • cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi VKas,

    Ok, I'm waiting for your feedback.

    It will be glad if your problem could be solved.

    Regards,

    Clofly

  • Vkas Profile Picture
    15 on at
    RE: Change hyperlink on Entity filed as link

    Hi Clofly,

    The earlier solution also worked perfectly for me, but I will try this as well.

    Let me try this (CCS solution) and do end to end testing.

    I will update you soon.

  • Suggested answer
    cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi VKas,

    I found a better solution to always hide address column, it will only use CSS.

    1. Remove the JavaScript code for hiding column.

    pastedimage1592529347304v1.png

    2. In web page which contains entity list, open corresponding localized content page record.

    3884.JPG

    3. Add CSS code below to Advanced > Custom CSS(nth-child(3) selector will hide the 3rd column,)

    table tr th:nth-child(3) {
        display: none;
    }
    
    table tr td:nth-child(3) {
        display: none;
    }

    pastedimage1592529540658v2.png

    4. Result:

    Now Address column can be hidden from beginning, and will be always invisible.

    And copy process is not affected.

      pastedimage1592529709692v3.png

    pastedimage1592529730422v4.png

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi Vkas,

    1. We can hide address column after addresses have been copied to search engine column.

    $('table tr').find('td:eq(2),th:eq(2)').hide();

    pastedimage1592476169699v1.png

    Note: index in eq selector is different from nth-child selector: if index is 2, then it represents the 3rd column.

    Result:

    pastedimage1592476277222v2.png

    We will still see address column when list is being loaded, but the column will be hidden after 1 second.

    pastedimage1592476333475v3.png

    2. We couldn't just show text, because full url is actual value of address field.

    pastedimage1592476578223v4.png

    Regards,

    Clofly

  • Vkas Profile Picture
    15 on at
    RE: Change hyperlink on Entity filed as link

    Hi Clofly,

    This worked perfectly for me.

    But how I can now hide the address column. If I hide address column in my active view, the scripts does not works.

    Or else, is it possible to show just the text in address column instead of full url. Just like the links work in sharepoint columns where only description text is visible and if we click on it, it opens the actual URL.

    Thanks

    Vkas

  • Verified answer
    cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi VKas,

    Thanks for sharing your process, I added an entitylist to my web page by following your steps.(and I created a similar custom Company entity as yours to test.)

    Try to add code below to your Entity List > Options > Custom JavaScript

    $(document).ready(function () {
        $(".entitylist.entity-grid").on("loaded", function () {
            var rows = $("table tr td:nth-child(3)").length;
            for (var i = 0; i < rows; i  ) {
                $("table tr td:nth-child(2)").eq(i).css('cursor','pointer');
                $("table tr td:nth-child(2)").eq(i).hover(function(){ $(this).css("color","orange"); }, function(){ $(this).css("color","rgb(102, 102, 102)"); });
                $("table tr td:nth-child(2)").eq(i).attr('onclick', '(function(){ window.open('   '\''   $("table tr td:nth-child(3)").eq(i).text()   '\''   ', \'_blank\'); })()');
            }
        })
    }); 

    pastedimage1592468479308v1.png

    My Search Engine is the 2nd column, Address is the 3rd column. So I get cells text from the 3rd column and assign them to the 2nd column as an inline function.

    Example:

    If I hover over search engine cell text, the color will be orange and cursor will be pointer.(My snipping tool not supports to capture cursor.)

    If I click the highlighted text, a new tab will open and the URL is corresponding address value.

    pastedimage1592468783977v2.png

    It works well from my test. 

    Remember to change index number in nth-child(i) selector to your owns.

    Here is introduction about how to add custom javascript to entity list:

    https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/entity-lists#add-custom-javascript

    Regards,

    Clofly

  • Vkas Profile Picture
    15 on at
    RE: Change hyperlink on Entity filed as link

    Hi Clofly,

    The values are coming from entity fields. Here are the steps I am following:

    1. In Powerapps, I am getting data from either CSV, Excel or Sharepoint List ( All have these two columns)

    2. Importing the data to Entity fields One is text field and another as URL field)

    3. Showing these entity fields in powerapps portal page using list from portal components.

    pastedimage1592390606258v1.png

    4. The fields are from one of the view where I am showing my entity data as a list.

    5. The data is coming perfectly but I just do not want to show full URL to users. Instead I just want to show a clickable text (link) there. For example, If they click on "Bing" (link)text, the bing search given in address column should open.

    I have no idea of using liquid, but have tried javascript option on entity list options, but are not working.

    pastedimage1592390793820v2.png

    Yes, these columns are from custom entity I created before getting data from dataflows

    Thanks

  • cloflyMao Profile Picture
    25,208 on at
    RE: Change hyperlink on Entity filed as link

    Hi VKas,

    How did you render the list? By rewrite type web template or rendering it by liquid code manually?

    It seems that "SearchEngine" and "Address" columns are fields of a custom entity, and could you share me your setting that how to make text be clickable?(would it be a default behavior if text is URL?)

    If you render list by liquid, then you could nest SearchEngine text under a tag.

    e.g:

    <a href="{{ item.address }}">{{ item.searchengine }}</a>

    You could take article below as reference:

    https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/render-entity-list-current-page

    Regards,

    Clofly

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 149 Super User 2025 Season 1

#2
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 53 Super User 2025 Season 1

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 32 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans