12.8. Parameter Example: Google Maps Link
In this lesson, we'll dive into an exciting example that demonstrates the use of text-based parameters. We'll create a text-based parameter that allows users to input an address and generates a Google Maps link based on the entered address.
- Understand the purpose and use of text-based parameters in Looker Studio.
- Create a text-based parameter with specific configurations.
- Use the HYPERLINK() and CONCAT() functions to generate dynamic links based on user input.
- Apply the concepts learned to real-world scenarios and use cases.
- Finalize user input and understand the importance of clicking outside the input box.
Creating a Text-Based Parameter
Creating a text-based parameter is simple and follows a similar process as other parameters. In this example, we'll create a parameter called address. The configuration for this parameter is as follows:
- Name: address
- Type: text
- Default value: Enter your address
The data type for the address parameter is text, and we've set it to accept any value. You could also set the text parameter to have a list of values, such as countries, cities, departments, or sales managers. You can then assign this list to a dropdown control.
Using the Address Parameter
When the user enters an address, we can use the entered text value to generate a Google Maps link. Keep in mind that you can enter any text that Google Maps can interpret, such as a famous landmark or a specific street address.
Note: The entered address will not be finalized until you click outside of the input box.
To create a link, you can use the
HYPERLINK() function along with the
CONCAT() function. In this example, we use the following formula:
HYPERLINK(CONCAT("https://maps.google.com?q=", [address]), "Google Maps Link")
This formula concatenates "https://maps.google.com?q=" with the user-provided address and sets the title as "Google Maps Link."
Example use case: Some users may want to create links to specific marketing campaigns by entering the campaign name. If you know your URL structure for the tool you use to manage campaigns, you can construct a link like the one demonstrated in this lesson.