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 / Passing Doc Library Fo...
Power Apps
Answered

Passing Doc Library Folder Path in the URL

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

I have put together a basic JSON Script that opens my PowerApp and send the ID of the currently selected file in a document library.

 

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/sp/column-formatting.schema.json",
  "elmType": "a",
  "attributes": {
    "iconName": "Mail",
    "target": "_blank",
    "href": {
      "operator": "+",
      "operands": [
        "https://web.powerapps.com/apps/d85a1236-6d47-4f28-97c3-9309396fxxxx?DocID=",
        "[$ID]"
      ]
    }
  }
}

 

 

This works fine PowerApps is opened and I can extract the ID into a variable and then get more information by connecting to the document library and looking up the information based on the ID.

 

The problem is this is fine for one Document Library but I need to use this script across muliple document libraries meaning multiple Data Connections.   I plan to pass the folder path in the URL and then use an if Statement to determine which library to connect to.

 

Could anybody help my to Structure the URL Code I am really struggling to Append the FilePath, I assumed it would be something like

 

   
        "https://web.powerapps.com/apps/d85a1236-6d47-4f28-97c3-9309396fxxxx?DocID=",
        "[$ID]"&FilePath="[$FilePath]"

 

But this does not seem to work.

 

Many Thanks

Jamie

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Could you please share a bit more about your scenario?

    Do you want to open your PowerApps app using URL link and pass a SP folder path variable into it?

     

    Please take a try to modify your formula as below:

    {
     "$schema": "https://developer.microsoft.com/en-us/json-schemas/sp/column-formatting.schema.json",
     "elmType": "a",
     "attributes": {
     "iconName": "Mail",
     "target": "_blank",
     "href": {
     "operator": "+",
     "operands": [
     "https://web.powerapps.com/apps/d85a1236-6d47-4f28-97c3-9309396fxxxx?DocID=",
     "[$ID]",
     "&FilePath=",
     "[$FilePath]"
     ]
     }
     }
    }

    then check if the issue is solved on your side.

     

    In addition, if you want to pass parameters into a PowerApps app, please check if the following article would help in your scenario:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/embed-apps-dev#set-uri-parameters-for-your-app

     

     

    Best regards,

    Kris 

     

  • YuliyaHaradniuk Profile Picture
    Microsoft Employee on at

    would you be able to explain how you extract the ID into variable? 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @YuliyaHaradniuk 

    Param(DocID) in this case.

     

    Take a look at the Param function for more details.

     

    Hope this helps.

  • Verified answer
    YuliyaHaradniuk Profile Picture
    Microsoft Employee on at

    yes, it worked! my powerapps app was just too slow to display the published changes. One more question. Have you ever figured out how to pass file path in the url?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @YuliyaHaradniuk 

    Out of curiosity, why are you trying to pass all this information into PowerApps rather than get it from within PowerApps?

  • YuliyaHaradniuk Profile Picture
    Microsoft Employee on at

    I have a scenario where I need users to fill out a form first before they can open a specific document in the document library. I was thinking to create a button (custom formatted field) for each document in a document library that would open a PowerApps form and pass DocID and other parameters to the app. In the app I would ask users to fill out additional fields, and only when submitted, a user will be navigated to the file (either through launch function or a link on confirmation page). I guess i'm struggling with getting a link in the app back to the file.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @YuliyaHaradniuk 

    I thought there might be something like that going on...

    So, the reality is, the only thing you need is the ID of the document item in the library.

    How are you building your App?  As an App or an integration to your Library list?

     

    Either way, both will give you the information you need.  If it's an integration, then you can get most everything you need from the SharePointIntegration with the SelectedListItemID.  If it is a custom App, then you can just Lookup the ID or, in your case you are passing in the parameter for the DocID already.

     

    In your App, have a connection to the Document Library and lookup the Item.

    You will then have every bit of information you need from the Library.

     

    So, again, 1) pass in the ID via URL, or with SharePointIntegration, you've got it already.  2) Lookup the item in the library by ID and you will have all information needed.

     

    Hope this is clear and sheds some light.

  • YuliyaHaradniuk Profile Picture
    Microsoft Employee on at

    I'm building my app off a separate sharepoint list (same site) but it will be launched from the document library (via formatted column). I need a user to submit some information before they can open a file. The information will be saved in this SharePoint list and not Sharepoint library where the file lives. Hope this makes sense. 

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @YuliyaHaradniuk 

    Yup...makes perfect sense and the scenario I layed out still applies...pass the ID for the item in the Doc library and then get everything you need from a lookup in PowerApps.

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard