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
Solved! Go to Solution.
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?
Hi @JamieD76,
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:
Best regards,
Kris
would you be able to explain how you extract the ID into variable?
Param(DocID) in this case.
Take a look at the Param function for more details.
Hope this helps.
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?
Out of curiosity, why are you trying to pass all this information into PowerApps rather than get it from within PowerApps?
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.
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.
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.
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.
User | Count |
---|---|
141 | |
137 | |
78 | |
77 | |
72 |
User | Count |
---|---|
228 | |
178 | |
68 | |
68 | |
58 |