Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Portal - url query strings to fetch similar name variable

  • 1.  Portal - url query strings to fetch similar name variable

    Posted May 14, 2020 03:46 AM
    Dear experts,

    I am generating a text box dynamically, which has the same name in the form, when I submit this, the query string becomes like this.

    www.domain.com/page?animals=cat&animals=dog&animals=fish

    Now, how do I fetch this using Liquid?

    I tried Request.Params["animals"]. but it only gives me the last value which is fish. Anything that I am missing? I need to get all values of animals variable.

    Also, the loop to search through Request.Params is not working.
    If anyone can reply many thanks.

    Kind regards,

    ------------------------------
    Jimmy mcad

    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Portal - url query strings to fetch similar name variable

    MICROSOFT MVP
    Posted May 21, 2020 10:45 AM
    Hi Jimmy,

    Having duplicate keys in the query string is handled differently by different languages, and based on your description it appears Liquid simply gets the last one.

    I'd recommend using request.query to get the entire query string, and then you'll have to parse it out yourself.

    Nick

    ------------------------------
    Nicholas Hayduk
    Engineered Code Consulting Inc.
    Regina SK
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role