Skip to content

Commit

Permalink
Update docs/canvas/canvas-expression-lifecycle.asciidoc
Browse files Browse the repository at this point in the history
Co-Authored-By: Catherine Liu <catherineqliu@outlook.com>
  • Loading branch information
timductive and cqliu1 committed Jan 2, 2020
1 parent 2cd2ae6 commit c9b8dad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/canvas/canvas-expression-lifecycle.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ The expression does the following:
* Compares the value to `100`
* Returns `true` if the value is 100 or greater, and `false` if the value is 100 or less

That boolean value becomes the value for the `condition` argument. The output from the `then` expression is used as the output when `condition` is `true`. The output from the "else" expression is used when `condition` is false. In both cases, a base64-encoded image will be returned, and one of the two images will be displayed.
That boolean value becomes the value for the `condition` argument. The output from the `then` expression is used as the output when `condition` is `true`. The output from the `else` expression is used when `condition` is false. In both cases, a base64-encoded image will be returned, and one of the two images will be displayed.

You might be wondering how the <<getCell_fn, getCell>> function in the sub-expression accessed the data from the <<demodata_fn, demoData>> function, even though <<demodata_fn, demoData>> was not being directly inserted into <<getCell_fn, getCell>>. The answer is simple, but important to understand. When nested sub-expressions are executed, they automatically receive the same _context_, or output of the previous function that its parent function receives. In this specific expression, demodata’s data table is automatically provided to the nested expression’s `getCell` function, which allows that expression to pull out a value and compare it to another value.

Expand Down

0 comments on commit c9b8dad

Please sign in to comment.