query strings in macros

Rita Mikusch asked on August 28, 2018 23:41

Hi,

I'm having problems getting the query string in my macro to work ... hopefully somebody can tell me why it's not working :).

THIS WORKS ... it returns a "6": {%LocString="6;";return LocString.Split(";")[0]#%}

This DOES NOT WORK. The URL has a "location=6;" query string in it: {%LocString=QueryString["location"];return LocString.Split(";")[0]#%}

I tried adding a "ToString()" and it doesn't work either: {%LocString=QueryString["location"].ToString();return LocString.Split(";")[0]#%}

(I'm running this macro as part of a "smart search condition" in a "smart search result" webpart.)

Thank you.

EDIT: I also tried this and it didn't work: {%LocString=QueryString.GetValue("location");return LocString.Split(";")[0]#%}

Recent Answers


Rita Mikusch answered on August 29, 2018 00:22

Please ignore this question ... that QueryString is probably working fine. I'm just doing something wrong with the smart search filter and results webparts.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on August 29, 2018 00:42 (last edited on August 29, 2018 00:46)

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.