Hello,
Looking for advice on if its possible to read the querystring values of the parent sharepoint page that a powerapp is embedded into using the PowerApps WebPart. I have some javascript code for reading querystring of the parent of an iframe, but not sure if this could be implemented using PCF?
Very new to PCF, just looking for a plausible solution to the problem. I already know we can pass parameters to PowerApps, but I need this to be dynamic and embedded in SharePoint. e.g. multiple links to a SharePoint page with different querystring parameters.
Thanks in advance,
Craig
Gotcha! I'm not a SP expert in any meaning. Any chance you can create one parameter on SP side and bypass your dynamic parameters query as encoded query inside? That's how we used to do it in webresources of dynamics.
Thanks for the reply but this does not work when the app is embedded inside a sharepoint page. We can use querystring parameters, but they are fixed inside the webpart. so I cant call the link to the SharePoint page with different parameters, I would need a dedicated SharePoint page for each possible parameter value, which is what I want to avoid. the SP page also has other things on it, like search result webpart.
Check the following article - https://devoworx.net/how-to-get-query-string-value-in-powerapps/
It might be you have no need in PCFs at all.
I have not tried anything yet, since I want to check first if what I want to do is even possible.
If I could use the code below somehow in a PCF, is it possible to get the output of the function into a variable or collection within powerapps when the app is started?
function getQueryString() { var queryStringKeyValue = window.parent.location.search.replace('?', '').split('&'); var qsJsonObject = {}; if (queryStringKeyValue != '') { for (i = 0; i < queryStringKeyValue.length; i++) { qsJsonObject[queryStringKeyValue[i].split('=')[0]] = queryStringKeyValue[i].split('=')[1]; } } return qsJsonObject; }
Hello,
Did you try something like this - https://developer.mozilla.org/en-US/docs/Web/API/Location/search
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1