Handling Multi-Template Matches
This is an enhancement of the Template Matching feature.
The Problem: Multiple Template Candidates
If you’ve created a template for an image pattern that has multiple candidates on a page, you can't predict which of them the OCR connector will return at run time. So you must uniquely identify the template match you need.
You can try to do this by specifying the expected coordinates of the target pattern when designing your scenario. But the layout of application pages is often variable, and the coordinates may not be accurate enough to ensure a correct hit at run time.
The Solution: 'Labelled By'
There's a better way to identify the location of the target image pattern at run time that doesn't depend on accurate coordinates: specifying a reference label through the property "Labelled By".
In the example screen below, there are two occurrences of the search field (shown with yellow borders) and two occurrences of the gear icon (red borders):

The implementation of the new feature works by looking at the items around the target template (shown below with green borders). At design time, the bot developer must label the target template with the nearest item.

-
Create a template for the gear icon:
-
Select the zone around the icon
-
Right-click on the zone rectangle
-
Select Create new Template from image selection from the context menu
-
-
Select the nearest text and create an item for it
-
Set the item created in step 2 as 'Labelled by' in the parameters for the template
At runtime the distances d1 and d2 between the two template instances and the label item are calculated and as d1 is smaller, the second template is recognized.

This method still works if the application screen is resized and the spacing between the controls changes. The OCR connector still finds the template that is nearest to the label you have specified.
Using this method improves the stability and resilience of your bot.