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 / PCF to read querystrin...
Power Apps
Unanswered

PCF to read querystring from PowerApp embedded in SharePoint page?

(0) ShareShare
ReportReport
Posted on by 4

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

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    Did you try something like this - https://developer.mozilla.org/en-US/docs/Web/API/Location/search

  • craigT Profile Picture
    4 on at

    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;
     }

     

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    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.

  • craigT Profile Picture
    4 on at

    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.

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    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.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard