Some of our most useful and generic standard validations are IsDataFoundInTableOrView and IsDataNotFoundInTableOrView. Both of these validations allow you to look in any view or table and validate that the data exists or not.


For example, if you want to check in a Pallet table if the pallet exists, then this is the validation you would use. Often however, it is not enough to look just for one piece of data, you may want to also check other conditions. In the pallet example, you may want to check that the pallet exists, that it is active and that it is not in an inspection status. This is possible by adding conditions to your validation.


The process for adding these conditions is described here.


Normally when you do you mapping for this kind of validation you specify the table or view name to use and then which value you are looking for. When doing conditional mapping however, all you do is specify the name of the table or view and then select the Condition Mapping tab as below.



On the condition mapping tab you will see all the columns in the table you selected. Right click on a column you want to map. In our example we are looking in a view to confirm that the stock code exists in the view when the Warehouse matches the warehouse we have scanned and the StockOnHand column is great than zero.


Select Warehouse and right click to see the Map option.



Select Map to see the mapping form. This looks a lot like the normal mapping form. You can select to map the warehouse column to a step value, a fixed value or a standard value. However you can do one more thing - you can also select if the value you are mapping should be the same as the data, or match another criteria. For example we want Quantity on Hand to be greater than 0 so for Quantity we would map as follows:





The form header tells you which column you are mapping. You then select your filter option and then select to map that column either to a step in the function or as we have done here to a fixed value.