Passing parameters from a calendar popup to a Page Include (which row number?)

  • 1
  • Question
  • Updated 4 years ago
  • Answered
So I have a popup on the calendar view and I want to pass parameters from inside a tab to a page include component.

I'm passing the following parameter from the popup with the page include:

•AccountID={{$Model.Appointment.data.0.Case__r.Account__r.Id}}


Everything works, except that it displays data for row 0. How do I specify the row of the popup?


Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
  • my keyboard

Posted 4 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Pass in another value to the page include Query String then use it in the model of the page in the page include.
AccountID={{$Model.Appointment.data.0.Case__r.Account__r.Id}}&ApptID={{$Model.Appoinment.data.0.Id}}

Why not only set the ApptID to the page include page? That way you can use it to reference the AccountID using a field from the Appointment model. So just:
ApptID={{$Model.Appoinment.data.0.Id}}
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Brilliant! I was over complicating the problem. I passed the parameter to a new model on the Skuid page and then filter the Appointments model based on that criteria.

Thanks Pat!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Thanks go to Rob. He cleared it up for me today.
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Oops. I spoke too soon. I thought it worked because I have limited test data in my org.

It's still returning the 1st row every time, instead of the row selected row. Does that make sense?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Ok. Why are you using {{$Model.Appoinment.data.0.Id}} VS just {{Id}}?
{{Id}} would be appropriate if you're using a row action in a table.
Where are you calling the popup action from? As in, which model and row are you calling it from?
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
To break down this line "{{$Model.Appoinment.data.0.Id}}" for you...
"$Model" refers to the list of models
"Appointment" refers tot the model named Appointment
"data" refers to the data contained within the model
"0" is the first element of the array of data in the model, So 0 always refers to the first row
"Id" is the Id field for the row at element 0
What you want, is the row in context, so that when a user clicks on a row they will pass in the Id of that row. I believe that Pat's suggestion will work because {{Id}} will get you the row in context by default. You might have to manually specify it though.

Check out this link: http://help.skuidify.com/m/11720/l/187263-global-merge-variables-functions
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Derka durr - it was working because I used {{id}} instead of {{Id}}


Thanks dudes!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Derka durr???

Lol! I've done that so many times. Missed just the one character. Spent hours once on the extra r in Currrent. 
Photo of Griffin Brown

Griffin Brown

  • 2,766 Points 2k badge 2x thumb
Derka Durr - Obscure South Park reference (https://www.youtube.com/watch?v=x8WXBttpm7c)
Thanks for the help :-)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You guys are the best! I'm totally incorporating Derka Durr into my vocabulary - which previously just consisted of "Doh"  and "Epic Fail"....