Map data source searches
Data source columns are typically mapped to searches. Meaning, you search for something, and the results of that search populate several controls on the page. The Search for Order # search in the Warehouse App is an example. Users search for an order number, and this populates fields such as recipient and address. This topics covers how to set this up in Designer.
When configuring searches, there are two key aspects:
- You need one Textbox control (it has Input Box as the tooltip) with its Action set to Data Engine Lookup, and Source Name and Column set to the data source and column that the lookup will be performed on. This is the control that users will enter their search into. Search Textbox controls have the icon when selected in Designer.
- With the search Textbox control selected (this is essential), you then need to map all the Textbox controls that will be populated as a result of the search. You use the Data Sources panel to map data source columns to controls. icons display against mapped controls with tooltips showing the mapped column.
Add a Data Engine Lookup (search)
There is a precise sequence associated with this. If you do not follow it, you will get errors.
- Place all your Textbox controls on the page. Meaning the control that will form the search, and all the controls populated when the search returns.
- Configure the Textbox control that will perform the search. In its Properties panel:
- Set Action to Data Engine Lookup.
- Set Source Name to the data source. Click in the box to select one from a list. Note that all of this assumes you have created your data source, and that it includes all the columns you need.
- Set Column to the data source column that you will search on. This should be a column that is suitable for searching. Again, click in the box to select from a list of columns in the data source set in Source Name.
- Map the remaining Textbox controls to the data source columns that will populate them. To do this:
- Ensure the search control is selected (showing ). This is essential to create the association ('tie back') between the search and the controls it populates.
- In the Data Source panel, expand the data source, so that you can see its columns. The column that you mapped to the search control has against it.
- Click the icon next to a column, and then click the control that you want to map to it. When you do this, the mouse cursor changes to a . In the next image, you can see the point of mapping and then, in the insert, the result on the page. Designer displays a message on each successful mapping, and two icons ( and ) appear beside the control. Repeat this until you have mapped all the controls.
Whenever you are mapping a search, the key thing to remember is that you need one Data Engine Lookup control pointing at the data source, and it must be selected when you map the associated controls.
Mapping Warnings and Errors
You are trying to create a mapping without having first selected the search Textbox control that will service that mapping. Select the search control before you attempt to map anything. It must be a Textbox control with Action set to Data Engine Lookup, and Data Source and Column set to the data source and lookup column. | |
You are trying to map to a Textbox control has its Action set to Data Engine Lookup and therefore cannot be populated as a result of another search. Only the search control needs to have Action set to Data Engine Lookup. All the other controls populated by the search should be left with Action set to None. | |
Whilst in mapping mode, you have clicked on something that is not a control on the canvas, for example, something in Properties. To prevent this repeating, with the same data column selected in the Data Sources panel, click Remove Related Mappings (at the bottom of the Data Sources panel). This resets the mapping and you can proceed to map it to a control. |
The Operator setting
In a Data Engine Lookup search, the Operator determines what pattern matching is used by the search. You can choose between IsEqual (the default), Contains, StartsWith, and EndsWith.