This type of data source helps you obtain the values which will populate the custom field using SQL scripts.
...
Info | ||
---|---|---|
| ||
If you want to use two columns at the select statement, note that the first column will be considered as the label, and the second will be the value. |
...
If you have a custom field with autocomplete and you want to set Min. chars on 0, you need to write the following sql scripts: SQL Initial Script and SQL Autocomplete Script.
Code Block | ||
---|---|---|
| ||
select brand from car_parts where name like 'Door'; |
...
If you have a custom field with autocomplete and you want to set Min. chars on a value greater than 0, you need to type the SQL Autocomplete Script.
Code Block | ||
---|---|---|
| ||
select brand from car_parts where name like {query} || '%'; |
...
If you have a custom field with no autocomplete, you need to type the SQL Initial Script.
Code Block | ||
---|---|---|
| ||
select id from car_parts where brand like 'Toyota'; |
...