Pull

Takes three parameters, QueryName, FieldBase, FieldNames

Usage:

QueryName, FieldBase, FieldNames
QueryName, [""], FieldNames
QueryName, [WorkWith], FieldNames
[TopQuery], [""], FieldNames

Description:

The Pull command (for the Work Query) will take a list of space separated Field names that we want to Ensure in our current Work Query, and then copy those Field values from the Source Query if they exist, and set them to blank if they do not exist.

If a Source Query is not specified, the Source Query will be the Top Query.

Inside a WorkWith block:
If the Pull command's FieldBase parameter is used, the WorkWith name scope will be used for the Destination.
If the Pull command's FieldBase parameter is left blank, the WorkWith name scope will be used for only the Source Query.

It is acceptable for the Field Base of the Source Fields and Destination Fields to not match; they will be transposed from the Source Field Base to the Destination Field Base.

An equivalent command with a destination of the Top Query is [Pull], with the Top Query syntax of the surrounding [ ]. It will instead default to pulling from the Request Query, not the Top Query.

Examples:

Pull    "Request", "ToDo.List.", "Name DueDate"           'WQ fields: Name DueDate
Pull    "Request", "ToDo.List.Name ToDo.Item.Name"        'WQ fields: ToDo.List.Name ToDo.Item.Name (Pulls from Request Query)
Pull    "ToDo.List.Name ToDo.Item.Name"                   'WQ fields: ToDo.List.Name ToDo.Item.Name (Pulls from Top Query)

The example below demonstrates how the WorkWith command works with Pull. The Output query will have the same fields in both cases. The difference is that in the first example the fields "Name DueDate" are pulled, whereas in the second example the fields "ToDo.List.Name ToDo.List.DueDate" are pulled.

NewQuery "PullQuery", "", "y"
    SetNew "Name", "`This PullQuery field is Name"
    SetNew "DueDate", "`This PullQuery field is DueDate"
    SetNew "ToDo.List.Name", "`This PullQuery field is ToDo.List.Name"
    SetNew "ToDo.List.DueDate", "`This PullQuery field is ToDo.List.DueDate"

WorkQuery "Output"

WorkWith "ToDo.List"
Pull "PullQuery","Name DueDate"
End WorkWith

'WQ fields: ToDo.List.Name ToDo.List.DueDate
'Pulled from TestQuery fields: Name DueDate

Reset

WorkWith "ToDo.List"
Pull "PullQuery","ToDo.List.","Name DueDate"
End WorkWith

'WQ fields: ToDo.List.Name ToDo.List.DueDate
'Pulled from TestQuery fields: ToDo.List.Name ToDo.List.DueDate