Forum Discussion
Preserve SharePoint List absolute URL in report
- Anonymous2 years ago
Hi gemcityzach
You can use this
= Table.TransformColumns(#"Changed Type", {{"Link_to_record", each if _="" then "https://sharepoint.companyname.com/teams/XXXXX" else "https://sharepoint.companyname.com" & _, type text}})Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
You can use Power Query to re-inject the missing "https://sharepoint.com" into the string.
- gemcityzach2 years agoHelper IV
This is super helpful. When I use the 'add prefix' it makes for a simple solution but introduces a complexity I'd like to try and resolve.
PowerQuery Wants to Do This
{{"Link_to_record", each "https://sharepoint.companyname.com" & _, type text}}
And it works great except that our URL's are formatted "https://sharepoint.companyname.com/teams/XXXXX" and the relative URL I am getting from SharePoint is "/teams/XXXXX/......".
Not every record will get populated with a value in SharePoint. So, when I do the prefix, it puts a URL "https://sharepoint.companyname.com", which the user will mistakenly click and be sent to an Error 404 page. The same would be true if I tried to add "teams/XXXXX" then while the records with no URL would get a valid URL, then the records that have a URL would get an invalid URL "https://sharepoint.companyname.com/teams/teams/xxxxx/....".
Is there a way to use a custom column approach handling the blank URL fields first? Like:
each if [Link_to_record] = "" then "https://sharepoint.companyname.com/teams/XXXXX" else PREFIX the value correctly- Anonymous2 years agoNot applicable
Hi gemcityzach
You can use this
= Table.TransformColumns(#"Changed Type", {{"Link_to_record", each if _="" then "https://sharepoint.companyname.com/teams/XXXXX" else "https://sharepoint.companyname.com" & _, type text}})Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!- gemcityzach2 years agoHelper IV
This worked out nicely. Thank you!