Data Sources: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 8: Line 8:


== Lifecycle of an Autofill from a custom data source ==
== Lifecycle of an Autofill from a custom data source ==
# A user types text in a field in an Entry Edit card.
# A user types text in a field in an Entry Edit card for use as a key to look up information.
# The entered text is passed to the custom data source script in the form of the global variable '''''query'''''.
# The entered text is passed to the custom data source script in the form of the global variable '''''query'''''.
# The data source script is executed.
# The data source script is executed.
# The user is presented with a list of objects found by the script.
# The user is presented with a list of objects found by the script.
# The user selects an object its arguments written into the entry fields according to data load rules.
# The user selects an object, and its properties are written to the mapped entry fields according to data load rules.
# If a function is returned as a result of the script, the script function is executed and the result is loaded into fields according to data load rules.
# If a function is returned as a result of the script, the script function is called with the selected object's id property as the argument, and the returned object's properties are loaded into mapped fields according to data load rules.


== Adding a custom data source ==
== Adding a custom data source ==