How i will get current url parameter and pass that value in one of the field of my model

  • 1
  • Question
  • Updated 3 years ago
  • Answered
Photo of paras jain

paras jain

  • 264 Points 250 badge 2x thumb

Posted 3 years ago

  • 1
Photo of paras jain

paras jain

  • 264 Points 250 badge 2x thumb
How i will get current url parameter.....i have to get id from current url  and want to set automatically to the lookup field of my Model....
Photo of paras jain

paras jain

  • 264 Points 250 badge 2x thumb
I have got Url id by using js:-

var query = window.location.search.substring(1);
var CompId  = query.split('&id=')[1];

Now i have to set this value in field of Model....
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I think you can use skuid.page.params to get your value (not currently documented, except in a backwards way through the merge syntax documentation).

That said, is there a reason you can't just set a url param condition on your model instead of doing it with javascript?
(Edited)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You can use the action framework to populate a URL parameter to a field. 
Your action framework should use the "Update field on row" action - and use global merge syntax to send the URL parameter to the field.  {{$Param.<parameterName>}}
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Excellent, thank you. Works great!