lowdefy/packages/docs/operators/_operator.yaml
2021-01-27 11:51:43 +02:00

46 lines
1.6 KiB
YAML

# Copyright 2020-2021 Lowdefy, Inc
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
_ref:
path: templates/operators.yaml.njk
vars:
pageId: _operator
pageTitle: _operator
types: |
```
(arguments: {operator: string, params: any): any
```
description: |
The `_operator` operator evaluates an operator with the given params. This is useful if the operator needs to be chosen dynamically. The `_operator` cannot evaluate itself.
arguments: |
#### object
- `operator: string`: The name of the operator to evaluate.
- `params: any`: The params to give to the operator.
examples: |
#### Get a value from `urlQuery` if specified, else use the value in `state`:
```yaml
_operator:
operator:
_if:
test:
_eq:
- _state: location_selector
- url_query
then: _url_query
else: _state
params:
key: field_to_get
```
Returns: Value from `urlQuery` if `location_selector == url_query`, else the value from `state`.