This tutorial shows how to use URL Merge Conditions to limit the data returned by your REST models. In this example, we’re going to use to show the local time for a given Account based on its latitude and longitude.

Step 2: Create a model on the REST service you want to use and enter merge templates in the Data Source URL.¶

Create a new model.

Pick the appropriate REST Data Source.

Important: In the Data Source URL area, enter merge templates for the parameters that you’ll want to populate via a model condition. In this case we’re using {{Latitude}} and {{Longitude}} so we can create conditions to pull in the Latitude and Longitude fields from our Account Model.

A. If you are planning on populating these areas with fields from another model, make sure that model contains the appropriate fields.¶

B. It’s also a good idea to make sure these fields are populated for your example record.¶

A. The merge templates you specified in the Data Source URL will come up as options.¶

No Parameters available in this list? Make sure you entered merge templates in your Data Source URL in Step 2.

In this example we’re setting Latitude to the shipping Latitude field form the Account Model, and Longitude to the Shipping Longitude field from the account model. In Steps 2A & B we made sure we included these fields in the Account model, and that they actually had data in them.

To get fields, you may have to enter sample parameters (in this case Latitude and Longitude).

Make sure your test parameters will return the fields you want. For example, if my test latitude and longitude happens to be in the middle of the ocean, then this service won’t return the Time field, which is one of the fields I want. So I made sure my test lat and long were for a city (and not the Lost City of Atlantis).

If you accidentally enter test parameters that don’t return the fields you want, you can click the refresh icon next to All Fields and enter new ones.

Step 5: Click Save, then click Preview to open your page in a new tab.¶

Success! Thanks to our URL Merge Conditions we can see the date and time for this Account!¶

For example, this page uses URL Merge Conditions and Chart Drill-downs/ On-Click Actions to dynamically show key indicators based on the country selected in the pie chart. (Oh and those swanky big summaries, aka $1180 (billions) are totally Rich Text Components.)

You can get this page in your org by copying it from our GitHub repo and pasting it into your org. (Note: for the page to work, you need to configure 2 data sources, explained in more detail at the top of the page XML.) Learn more about copying and pasting pages.