WPIntell

Source evidence

URL Multiple Query Parameters

DataPress (Dataverse Integration) · support · 2023-03-13T12:01:00+00:00

mixedsentiment
mediumseverity
0.78relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 23 rows with source links

13.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
kimineko resolved
Hi there, how would I go about to use multiple parameters passed from an URL. In my case I would have an URL like this: https://website?id=firstparameter?ac=secondparameter According to the documentation request.query should contain all queries. However, I am unable to access each parameter individually, as the object contains the query as a string. So it always outputs firstparameter?/ac=secondparameter. Do I need another delimiter or what would be the correct schema for the url and the twig? Best Kim This topic was modified 3 years, 2 months ago by kimineko . Hi Kim, you can access parameters using request.params collection. See https://docs.alexacrm.com/integration-cds/twig/#get-current-request-information for more details. In your case it’d be request.params["id"] and request.params["ac"] Hope it helps AlexaCRM Hi, [icds_twig] {{ request.params["id"] }} {{ request.params["ac"] }} [/icds_twig] used with the following URL: https://mywebsite.com/institut/kontakt/confirm?id=testid?ac=testac returns testid?ac=testac for id and nothing for ac. It seems like the second ? is for some reason converted to “%3Fac%3D” – see the results of the following: [icds_twig] <table> <tr><td style="wdith: 300px;">params</td><td style="overflow-wrap: anywhere;">{{ request.params |join }}</td></tr> <tr><td>params id</td><td>{{ request.params["id"] }}</td></tr> <tr><td>params ac</td><td>{{ request.params["ac"] }}</td></tr> <tr><td>path</td><td>{{ request.path }}</td></tr> <tr><td>path_and_query</td><td>"{{ request.path_and_query }}</td></tr> <tr><td>query</td><td>{{ request.query }}</td></tr> <tr><td>url</td><td>{{ request.url }}</td></tr> </table> [/icds_twig] returns params {stamp:\'2yCBUwSIBd3Q4BK/vJyH1VYL2u/jFvkOMYdb9okBae9xm8RPAUIYDA==\',necessary:true,preferences:true,statistics:true,marketing:true, method:\'explicit\',ver:1,utc:1673555372631,region:\'de\'}44583ad0-beaa-4756-86e3-d51ae384bf41000cb5GA1.2.980823569.1678692787libraryContent=browse&ampampeditor=html&ampampeditor_expand=off&ampampunfold=1&ampampmfold= o&ampampimgsize=thumbnail&ampamped_size=487&ampampposts_list_mode=excerpt&ampamphidetb=0&imgsize=&mfold=o&unfold=1&posts_list_mode =excerpt&editor_expand=off&editor=html16786982561WP Cookie checki6003931|1679037413|MhnnJDZ9buVk4eY5ImpjmL5ThXeHkzbCTQWzlD4aaFI|99abaae5450195889f8a6dc86woo:QMoEVaoE0tPSImCI8yLL1GHe16486a82547087016eeecdce31a53e3991||1679037430||1679033830||e766579b11678867259.0.0.0testid?ac=testac params id testid?ac=testac params ac path /institut/kontakt/confirm path_and_query "/institut/kontakt/confirm?id=testid?ac=testac query ?id=testid%3Fac%3Dtestac url https://mywebsite.com/institut/kontakt/confirm?id=testid%3Fac%3Dtestac This reply was modified 3 years, 2 months ago by kimineko . This reply was modified 3 years, 2 months ago by kimineko . @kimineko your url is not constructed correctly. Parameters must be separated by & not by ? . Your url should be https://mywebsite.com/institut/kontakt/confirm?id=testid&ac=testac Thanks A very simple solution 😀 thank you

Comments

4 shown
alexacrm 2023-03-15T06:03:00+00:00

Hi Kim, you can access parameters using request.params collection. See https://docs.alexacrm.com/integration-cds/twig/#get-current-request-information for more details. In your case it’d be request.params["id"] and request.params["ac"] Hope it helps AlexaCRM

kimineko 2023-03-15T08:07:00+00:00

Hi, [icds_twig] {{ request.params["id"] }} {{ request.params["ac"] }} [/icds_twig] used with the following URL: https://mywebsite.com/institut/kontakt/confirm?id=testid?ac=testac returns testid?ac=testac for id and nothing for ac. It seems like the second ? is for some reason converted to “%3Fac%3D” – see the results of the following: [icds_twig] <table> <tr><td style="wdith: 300px;">params</td><td style="overflow-wrap: anywhere;">{{ request.params |join }}</td></tr> <tr><td>params id</td><td>{{ request.params["id"] }}</td></tr> <tr><td>params ac</td><td>{{ request.params["ac"] }}</td></tr> <tr><td>path</td><td>{{ request.path }}</td></tr> <tr><td>path_and_query</td><td>"{{ request.path_and_query }}</td></tr> <tr><td>query</td><td>{{ request.query }}</td></tr> <tr><td>url</td><td>{{ request.url }}</td></tr> </table> [/icds_twig] returns params {stamp:\'2yCBUwSIBd3Q4BK/vJyH1VYL2u/jFvkOMYdb9okBae9xm8RPAUIYDA==\',necessary:true,preferences:true,statistics:true,marketing:true, method:\'explicit\',ver:1,utc:1673555372631,region:\'de\'}44583ad0-beaa-4756-86e3-d51ae384bf41000cb5GA1.2.980823569.1678692787libraryContent=browse&ampampeditor=html&ampampeditor_expand=off&ampampunfold=1&ampampmfold= o&ampampimgsize=thumbnail&ampamped_size=487&ampampposts_list_mode=excerpt&ampamphidetb=0&imgsize=&mfold=o&unfold=1&posts_list_mode =excerpt&editor_expand=off&editor=html16786982561WP Cookie checki6003931|1679037413|MhnnJDZ9buVk4eY5ImpjmL5ThXeHkzbCTQWzlD4aaFI|99abaae5450195889f8a6dc86woo:QMoEVaoE0tPSImCI8yLL1GHe16486a82547087016eeecdce31a53e3991||1679037430||1679033830||e766579b11678867259.0.0.0testid?ac=testac params id testid?ac=testac params ac path /institut/kontakt/confirm path_and_query "/institut/kontakt/confirm?id=testid?ac=testac query ?id=testid%3Fac%3Dtestac url https://mywebsite.com/institut/kontakt/confirm?id=testid%3Fac%3Dtestac This reply was modified 3 years, 2 months ago by kimineko . This reply was modified 3 years, 2 months ago by kimineko .

alexacrm 2023-03-15T08:29:00+00:00

@kimineko your url is not constructed correctly. Parameters must be separated by & not by ? . Your url should be https://mywebsite.com/institut/kontakt/confirm?id=testid&ac=testac Thanks

kimineko 2023-03-15T08:49:00+00:00

A very simple solution 😀 thank you