How do you access the parameters passed into a page include?

  • 2
  • Question
  • Updated 10 months ago
  • Answered
I have page that I'm passing a parameter into via the query string parameter of the page include. My question is...how do I access those parameters when the popup comes up?
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I believe you can access normal page parameters with {{$Param.EnterParameterNameHere}} or be receiving the parameter into a model using model conditions then accessing the fields from that model. In Skuid page includes, the {{$Param.EnterParameterNameHere}} may not work.
Photo of Rajendra Rathore

Rajendra Rathore

  • 1,480 Points 1k badge 2x thumb
Hi Jaime,

If you have need access in javascript snippet then you can use below mentioned code:

skuid.page.params.id


Note: Please replace id with the parameters name that you are passing in page include

Thanks,
Raj
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Jaime,

Please note that {{$Param.nameOfParameter}} and skuid.page.params.nameOfParameter both only store the values of the 'visible' url. Thus, they cannot be used to get values passed to page includes.

To store a value passed to a page include, the most reliable method i've found is to create a model and field on the included page with a condition based on the url parameter that you're passing.
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
If you're using a salesforce model, you can use any object. Just make sure that you're never saving it (don't prevent leaving).
Photo of Ashwat

Ashwat

  • 768 Points 500 badge 2x thumb
How can I create a url param condition on a UI-only model? All I see on Ui-only models are fields and actions. I don't see a conditions option. It will have to be a salesforce model right?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
yes. I think skuid has changed that since I created my pages.
Photo of Ashwat

Ashwat

  • 768 Points 500 badge 2x thumb
So this is what I did based on your suggestion

This is the query string that I am passing to the page include

requestId={{$Model.OnboardingRequest.data.0.Id}}&accountTab=account&requestTab=request&tabsetName=ORDetailTabset

On the page itself, I created a model on a custom object that I am already using on that page and set it to create a default row if model had none. I created 3 ui only fields - accountTabName, requestTabName, tabsetTabname.

I added 3 conditions and for each condition, i set the value to the page parameters (accountTab, requestTab, ORDetailTabset respectively)

I then wrote a javascript snippet that looked at the model.conditions array and grab the value from there (eg - model.conditions[0].value) and assign it to the respective ui-only field. This snippet would run upon the model action of row being created.

And it all worked!!!

Thanks a lot Matt.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Glad you got it working. :)
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb
Hey Matt and Raj...thank you for your quick response. Your recommendations work for the pulling parameters from the main page url but not for what has been passed in to a popup that has a page include. What I observe is that I'm only able to get the parameters out of the main page.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Jaime,

Exactly what I was trying to say.

Have you tried this:
To store a value passed to a page include, the most reliable method i've found is to create a model and field on the included page with a condition based on the url parameter that you're passing.
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb
I did Matt which led me to trying to understand why it wasn't there. In looking in the console what I found out is that skuid.page has a list of pages. The main page and then the include. But I don't see a reliable way to get to the parameters of that specific page. I see the name given by Skuid but that probably changes by environment. I tried to query it by the Page Name but then it didn't give me all the parameters.