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 / Dynamically get the Sh...
Power Apps
Answered

Dynamically get the Sharepoint site URL of a Sharepoint Power App form

(0) ShareShare
ReportReport
Posted on by 31

I got a Power App form attached to a Sharepoint list I'm using as a developpement model.

Then, I'm using FlowPowerAppsMigrator to transfer the form to other Sharepoint sites made for clients.

 

I need to get the URL of the sharepoint site the form is currently on for some processing, however I can't seem to find a way to dynamically get it. I found this tutorial that is working, but require at least one item in the list, which isn't guaranteed.

 

Another way to do it would be to manually go change a static variable after migrating the model to the new site, which isn't ideal when there is already 10 sites and growing.

 

Any tips on it? This is quite an edge case, but I'd be glad to not have to do manual tweaking. I'm also willing to do Power Automate flows if needed.

Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @OmegaPhi115 - isn't this scenario exactly what Environment Variables are for?

     

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/environmentvariables 

  • OmegaPhi115 Profile Picture
    31 on at

    That would be a great solution, except I cannot add the form to a solution.

    To be clear, it's a sharepoint list form. One that shows up to edit the list directly. Not a Canvas App that drives a sharepoint list. Which means it's hidden from true powerapps

     

    Unless there is a special way to force it into a solution, that doesn't work sadly

  • Verified answer
    OmegaPhi115 Profile Picture
    31 on at

    I managed to fix this using a dirty yet effective trick. Essentially, on startup, I get the first item, get the url, then save it into a variable.
    If there is no items, I create a temporary new one, get its url, then remove it.

    If(
     !IsBlankOrError(First('List Exemple')),
     Set(
     sharepoint_link,
     First(
     Split(
     First('List Exemple').'Link to item',
     "/_layouts"
     )
     ).Value
     ),
     Patch(
     'Suivi tickets MODEL',
     {
     title: "Systeme",
     }
     );
     Set(
     sharepoint_link,
     First(
     Split(
     First('List Exemple').'Link to item',
     "/_layouts"
     )
     ).Value
     );
     Remove('List Exemple', First('List Exemple'))
    );

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 519

#2
WarrenBelz Profile Picture

WarrenBelz 439 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 433

Last 30 days Overall leaderboard