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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Open uploaded file lin...
Power Apps
Answered

Open uploaded file link in PCF

(0) ShareShare
ReportReport
Posted on by 293

I have a file column in my dataverse table. I have uploaded a file to my record and want to open the file from a link in a PCF that I am developing that resides on a custom page. When I retrieve the record's file value it provides a Value like :

 

 

appres://datasources/Results/table/slp_result/rows/5a3a6d68-2e9e-ec11-b400-000d3a5d31c5/fileimageurl/http:%2F%2Ftemp.url/column/slp_file/resourceid/bf6ac4b6-d2a2-ec11-983f-0022480b18d9

 

 

 

 

I am using a Link fluentUI tag that requires an href, I cannot figure out how to parse the correct href so that user can open this file. It seems like the href should look something like:

 

 

https://[my url].crm.dynamics.com/api/data/v9.0/slp_results(5a3a6d68-2e9e-ec11-b400-000d3a5d31c5)/slp_file/$value

 

 

 

 

 How do I reference my root url dynamically from inside the PCF code? When I use window.location.href, I get something like this:

 

 

about:blank?PowerAppsLanguage=en-US#%7B%22hideNavBar%22%3Atrue%2C%22antiCSRFToken%22%3A%22a7b90131-0757-4f64-b6b9-2b2f29ac00c3%22%2C%22paramsQuery%22%3A%22recordId%3Db63ea9b5-7a5e-ec11-8f8f-00224829f2c8%26id%3Db63ea9b5-7a5e-ec11-8f8f-00224829f2c8%26entityName%3Dslp_test%26etn%3Dslp_test%26canNavigateBack%3Dtrue%22%7D

 

 

 

 

Is there a property in the PCF context that could provide the root url?

 

 

 <Link href={href} underline>
 {file.fileName}
 </Link>

 

 

 

I have the same question (0)
  • Verified answer
    KASCHN Profile Picture
    293 on at

    There is  a property in the PCF context from a custom page. It is not typed but you can use:

     

     // -ignore
     console.log({ contextxrm: this.context.page.getClientUrl() });

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard