Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Use case
Select a country or several countries in a custom field based on a continent selected in another custom field.
Video
Widget Connector | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Script details
The options for the Continent custom field were taken from the database as well. The following scripts are used in this example:
Continent data source
Code Block |
---|
string[] continents = sql("myDB", "select distinct continent from countries"); return continents; |
Country data source
Code Block |
---|
string continent = argv["customfield_10109"]; //the dependent field string[] countries = sql("myDB", "select country from countries where continent = '" + continent + "'"); return countries; |
Note |
---|
For the moment, dependent fields can only be used by the two custom fields with autocomplete. From Power Custom Fields PRO™ PRO 4.0.0, you can now use the dependent fields on SQL data sources as well. In order to get the value set on the screen for one custom field, reference it like this: "argv[customfield_id]". |
See More
Child pages (Children Display) | ||
---|---|---|
|