I am writing a routine to check an incoming dataset before loading. The first step is to make sure the dataset has all the required attributes, the second step is to make sure the values in the attributes are valid. I am using the AttributeValidator for this second step. Unfortunately, when I am validating a value, I have to hardcode all the values in the Rule Configuration box. I would like to be able to read a table and get these values and populate it in the Rule Configuration box. How can I do this?
populate the values for the "in" validation rule from a list
Best answer by takashi
Hi @tnarladni, the Rule Configuration field in the AttributeValidator doesn't have any function that allows you to import the rule from an external table, but you can use an attribute value as a rule configuration here. For the In operator, if you add an attribute that stores comma-separated valid values to every input feature, you can then select it as the Rule Configuration.
For example, if the valid values are stored in a text file (a value per a row), read it with the Text File reader, concatenate the values with comma-separated format (Aggregator), merge it to all the features unconditionally (FeatureMerger), and set the concatenated values to the Rule Configuration in the AttributeValidator.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.