SOLVED

Velocity Script: Populating token output from a query string

Go to solution
Jason_Santo
Level 1

Velocity Script: Populating token output from a query string

Hi,


Very new to Velocity and have spent some time reading up on syntax, but I cannot seem to figure out something which seems simple: getting the ID query string out of a url formatted like this:

http://my.niftyurl.com/sub/company/blahblah.php?id=0000011&ST=QRS

The url is being pulled from a lead custom field (lead.rNSLink) and I'm successfully grabbing that. But I cannot figure out what to do with it to get the ID. I've tried things like "getParameter" and other Java functions, but nothing seems to quite fit the bill.


Help would be beyond appreciated.

Regards,

Jason

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Script: Populating token output from a query string

#set( $rNSId = $link.uri($lead.rNSLink).getParams()["id"] )‍‍‍‍

I don't know which getParameter you were referring to, but the servlet one wouldn't apply here.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Script: Populating token output from a query string

Please move the thread to Products‌. Move link will be at the right. "About" isn't a support space, it's for webmaster-type feedback.

Then we'll continue.

Jason_Santo
Level 1

Re: Velocity Script: Populating token output from a query string

Thank you for the rapid assist. I had no idea what any of the "Spaces" meant, so I appreciate being steered in the correct direction.

- Jason

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Script: Populating token output from a query string

#set( $rNSId = $link.uri($lead.rNSLink).getParams()["id"] )‍‍‍‍

I don't know which getParameter you were referring to, but the servlet one wouldn't apply here.

Jason_Santo
Level 1

Re: Velocity Script: Populating token output from a query string

Hi Sanford.

Thanks for the answer on this. It worked fine. I realized that getParameter was for the servlet late in the game, but I didn't find 1) the syntax as you have it and 2) getParams. Clearly I need to look harder within uri documentation.

Be well,

Jason