web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Re-Writing URL Field v...
Power Apps
Unanswered

Re-Writing URL Field via JS

(0) ShareShare
ReportReport
Posted on by 7

Hello 

 

keep getting null returned on this line:

var getFieldControl = window.parent.document.getElementById("aet_documents");

 

CallenAET_0-1628004296227.png

 

 

 

//Get Value works

var urlName = formContext.getAttribute("aet_documents").getValue();

 

Also is there a better way to use write this line:

 

getFieldControl.innerHTML = btnHTML;

 

btnHTML is comprised of: 

var btnHTML = "<a href='javascript: void(0);' onclick=\"window.open(\'" + url + "\', \'windowname1\'); return false;\" style='color:blue;text-decoration:underline !important'>" + description+"</a>";

 

 

Thanks for any insight!

 

 

 

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    Dom browsing (including use of window.parent) is not supported in client script because Msft reserves the right to change the Dom structure at any time and without notice. In fact, one such UI change is in preview as of yesterday, so expect any Dom browsing you write like this to break in a few months when those changes go GA.

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @CallenAET,

     

    Can you describe a bit more what exactly you are intending to achieve? That way we can guide you toward the right supported Dataverse client API methods. As @cchannon mentioned, manipulating the Dom directly is unsupported, with the exception being if you're manipulating elements in your own custom HTML web resource.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • CallenAET Profile Picture
    7 on at

    @cchannon , @ChrisPiasecki ,

     

    Thanks. Yes I am looking for something more robust than what I have that's for sure.

    My aim is/was to take the value of a URL field and make the link less unsightly. Its just the actual URL of the site that I want people to visit not descriptive text that is clickable. Ideally a dynamic href link where I control the url and the clickable text. The current URL field is populated via PowerAutomate on essentially a run-once trigger. So once the url value is written is unlikely to be overwritten.

     

    Thanks 

     

  • cchannon Profile Picture
    4,702 Moderator on at

    There is a URL type field in Dataverse. You could just use that and it will make the url a clickable link so you don't need to make a custom button.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard