Using mADL Rows

Now that you understand the principles of a basic mADL scrape, you can refine that scrape to only show those items on a page that are relevant. You do this by using Rows.

Rows are basic repeating patterns that are found on a web page. The system looks for a pattern that you define and returns all items that meet that pattern.

 In the Code Builder, once you've chosen and retrieved your source URL and defined the From and To points, see if you can identify any repeating patterns in the page.

Here:

And here:

... and elsewhere.

Select the repeating pattern and copy it to the Rows pane by clicking the Rows button:

Now you have to take out everything that could be unique about this particular instance of the pattern. For example, the screen shot below show that there is white space between tags which could vary from row to row, as well there are specific links referenced that will differ depending on which row is chosen. You need to remove those variables.

Removing/Formatting Variable Pattern Information

There are two ways to format this pattern so that it can be applied as a template for the rows:

  • Add Wildcard

A wildcard is used when the information contained in the pattern is both variable and you do not wish to format anything contained within it. An example would be an empty line.

Select the empty spaces or line and while still selected, click the 'Add Wildcard' button. This removes variable white spaces and replace with the 'wildcard' character.

Watch this short video for a demonstration:

 

 You will have something similar to this:

All variable white space has been removed.

  • Add Container

A container is something that holds variable information so that it can be formatted or otherwise used by the Platform. Use this if you wish to format Titles or links, or if you are planning on manipulating the information held within the container -- such as sending it to a backend system.

Select any variable that you wish to use and while still selected, choose 'Add Container. This removed the selected information displayed and replaces it with a Container.

See the video below for a short demonstration:

 

You should end up with something that looks like this:

Note that anything we might want to format or re-use has been placed into the Container, such as the Title.

After each change, it is a wise practice to test your changes in the 'Test Keyword' Pane.

The changes that have been made above result in the following, once 'Generate' and 'Run Code' have been used:

Once you are satisifed with the results, move to the Formatting area to format any Containers and therefore the results they display.

Formatting your Results

In the Body pane (below your Rows pane), click 'Show Containers':

By clicking on the Container name, you can both style the Container and choose in what order the results are displayed or whether to display them at all:

 In the previous screen shot, the Title has been formatted, and is separated by the Text Container by a line break, whilst the Link Container is not shown at all.

When 'Generate Code' is clicked, the code result is this:

Which in turn,  results in this, when 'Run Code' is pressed:

 Once you are happy with your results, copy and paste them into the 'madl Code' pane in the Interactions Manager:

Save your changes and your new mADL Interaction, using Rows will appear in your answerSpace.