URL Regex in webapp feedback/intercept project - URL parsing issue | XM Community
Skip to main content
I am trying to parse a URL with a regex in Embedded Data in a Website/App Feedback/Intercept survey.



I have tried to parse both the actual URL and the URL that Qualtrics seems to read and understand:

* Actual (in browser): https://websites.connectcdk.com/wsm/index.do?webId=motp-nitrademo2&locale=en_US

* Pulled into Qualtrics Survey Data (a bunch of HTML garb): https://websites.connectcdk.com/wsm/route/base-view/hydraDashboard?configCtx={"webId":"motp-nitrademo2","locale":"en_US","version":"WIP"}



We have written the following regex to parse the HTML-ey URL: [^\\?]+\\?.*webId["\\%22\\%3A\\:\\=\\&]+([^\\&\\%]+)

...and it works in the Regex tester (https://regex101.com/), but when plugged into my intercept project it pulls the webId as "3A" when it should be pulling "motp-nitrademo2".



Help! We have been troubleshooting this for weeks now and can't seem to come up with the right regex..
I assume you are doing this in JavaScript? Are you parsing the "pulled into Qualtrics Survey Data" url? If so, try just splitting on the = then use JSON.parse() on the second element in the returned array ([1]).
Turns out the regex was correct but this issue was related to being in a demo environment/URL weirdness.

Leave a Reply