How to Extract URL Query Parameters Into Variables

Problem Statement

You have a URL that has query parameters, e.g.:

https://example.com/confirm?wj_lead_email=324234gersonr123fr567756576567%40gmail.com&wj_lead_first_name=gersonpublis1123234hing3&wj_lead_last_name=&wj_lead_phone_country_code=&wj_lead_phone_number=&wj_room_password=&wj_lead_unique_link_live_room=https%3A%2F%2Fevent.webinarjam.com%2Fgo%2Flive%2F182%2Fnk2yyan9bnvu173a7v6&wj_event_ts=1722553200&wj_event_tz=America%2FSao_Paulo&wj_next_event_date=quinta-feira%2C+01+agosto+2024&wj_next_event_time=8%3A00+PM&wj_next_event_timezone=Rio+de+Janeiro%2C+Sao+Paulo+GMT+-3

You want to extract each query parameter pair into variables like this:

wj_lead_first_name → gersonpublis1123234hing3
wj_event_ts → 1722553200
wj_event_tz → America%2FSao_Paulo
etc.

Solution

You’ll need a minimum of a single module:

Explanation

  1. Remove the hostname and path of the URL. This can be done using the replace function.

    Screenshot_2024-08-02_090847

    This will leave the following part of the URL:

    wj_lead_email=324234gersonr123fr567756576567%40gmail.com&wj_lead_first_name=gersonpublis1123234hing3&wj_lead_last_name=&wj_lead_phone_country_code=&wj_lead_phone_number=&wj_room_password=&wj_lead_unique_link_live_room=https%3A%2F%2Fevent.webinarjam.com%2Fgo%2Flive%2F182%2Fnk2yyan9bnvu173a7v6&wj_event_ts=1722553200&wj_event_tz=America%2FSao_Paulo&wj_next_event_date=quinta-feira%2C+01+agosto+2024&wj_next_event_time=8%3A00+PM&wj_next_event_timezone=Rio+de+Janeiro%2C+Sao+Paulo+GMT+-3

  2. Split by the parameter delimiter &

    Screenshot_2024-08-02_090858

  3. Join by newline. This is because the Text Parser “Match Elements” module works with newlines.

    Screenshot_2024-08-02_090811

    This will result in the following text:

    wj_lead_first_name=gersonpublis1123234hing3
    wj_lead_last_name=
    wj_lead_phone_country_code=
    wj_lead_phone_number=
    wj_room_password=
    wj_lead_unique_link_live_room=https%3A%2F%2Fevent.webinarjam.com%2Fgo%2Flive%2F182%2Fnk2yyan9bnvu173a7v6
    wj_event_ts=1722553200
    wj_event_tz=America%2FSao_Paulo
    wj_next_event_date=quinta-feira%2C+01+agosto+2024
    wj_next_event_time=8%3A00+PM
    wj_next_event_timezone=Rio+de+Janeiro%2C+Sao+Paulo+GMT+-3
    
  4. Finally, let the Text Parser Match Elements module split the parameters by =

Hope this helps! Let me know if there are any questions or issues.

You can also join us in the Make Fans Discord server to chat with other makers. Due to the evolving needs of this community, the Discord invite link can be found elsewhere on this forum. You can either search for it or post below to request an invite.

4 Likes
Getting data from user's custom url
How can I continue the execution of a router when the output of the first module is empty?
Getting started into make
How to use AI to analyze salesforce case, then fill the lookup relationship field on the Case?
YouTube search automation: how to avoid duplicates and get a limited number of videos
Expert advice required and ideally contact
From iterare to pdfmonkey
Error Handling BAD combo: Sequential Processing + Incomplete Executions
Using Make
How to get a spreadsheet ID from a file I'm uploading in the same scenario?
Web Archive
How to merge results from multiple YouTube search iterations into one array?
Adding an item to a Pipedrive array without overwriting the original values
More operations then expected in HTML extraction
Recipe Card Automation
How to create a full Webflow CMS RSS feed using Make.com?
Use Custom GPTs (Team account) to create outlook drafts
SUM values of Make modules (Increment and variable)
Telegram bot watch update module missing?
New to Make and Social Media Automation
How to Connect Acuity "New Appointments" Contact details to Google Contacts?
How to fetch text from a bundle
How to loop over an array and generate HTML with native functions?
How to combine 2 scenarios?
Etsy - Gmail - Dropshipping Order Fulfillment Automation
Automated Follow-Up Emails After No Reply
Filter bundles based on the presence of a value in an array of objects
Working with dates inside an array
Data Enrichment - Make.com Automation Scenario
Can OpenAI in Make actually read PDFs directly (via file upload)?
Google Calendar Set current week date
Help with a Json Scenario
Guided product creation assistant
Meta integration with Clickup
Google Workspace Admin module configuration
Integration of Planyo with Lexware
Problem Capturing the First line from Facebook Post
I want to append page content into a database page from another database page content

Example Output

Mapping of Variables (optional)

If you want to make it easier to map these variables, you can aggregate to an array:

Then, use a Set Variable module to convert into a collection, using the toCollection built-in function:

Screenshot_2024-08-02_090842

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

3 Likes

This is amazing! Thanks! I’m new to Make, how do I configure my page to let this automation run? I think I can follow your steps in Make, but what do I need to do in my page to make this work? TIA

I think that my question comes down to how can I trigger all of this?

Put the URL into the text parser, shown in the screenshot in the first post, as the variable “Text”.