I've created a multivalue list of table field names by calling a python script in ModelBuilder. I'd like to iterate through the list of field names and create SQL queries for the "Select Layer by Attribute" tool. I'd also like to use the field name as an in-line variable in the query. I know how to use a value variable when constructing an SQL query (ex. "FIELDNAME" = '%variable%') but not with a field name. Is it possible?
How did you do it? We are trying to figure out the same thing, but are so new to python that we dont even know how to start.
We are trying to: Bring in a table and feature class and join them (easily done, not in question) Then calculate attributes in the feature class based on values in the joined table (mostly easily done). BUT I want to allow for error on join table field names. So I would like to have them identify each field as parameterized values up front, then use inline variable subsitution in the calculation arguments to specify those fields. I would like for the field varable prompts to provide a list of fields from the joined table to choose from. Thats the part I 'm having trouble with.