Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
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

  • a33ik Profile Picture
    3,304 Most Valuable Professional on at
    Re: PCF to read querystring from PowerApp embedded in SharePoint page?

    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.

  • craigT Profile Picture
    4 on at
    Re: PCF to read querystring from PowerApp embedded in SharePoint page?

    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,304 Most Valuable Professional on at
    Re: PCF to read querystring from PowerApp embedded in SharePoint page?

    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
    Re: PCF to read querystring from PowerApp embedded in SharePoint page?

    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,304 Most Valuable Professional on at
    Re: PCF to read querystring from PowerApp embedded in SharePoint page?

    Hello,

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

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard