From 84e570681a26dc4ce187a8feb7f19c347425d097 Mon Sep 17 00:00:00 2001
From: enured <enis.nuredini@uzh.ch>
Date: Fri, 20 Oct 2023 13:41:27 +0200
Subject: [PATCH] F15098: Added documentation for function column.  refs #15098

---
 Documentation/Variable.rst | 50 ++++++++++++++++++++++++++++++++++----
 1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/Documentation/Variable.rst b/Documentation/Variable.rst
index 0f58273e6..b8ec6e160 100644
--- a/Documentation/Variable.rst
+++ b/Documentation/Variable.rst
@@ -44,7 +44,7 @@ provided. Access to:
 * :ref:`store-variables`
 * :ref:`sql-variables`
 * :ref:`row-column-variables`
-* :ref:`link-column-variables`
+* :ref:`link-function-column-variables`
 
 Some examples, including nesting::
 
@@ -72,6 +72,12 @@ Some examples, including nesting::
   # Link Columns
   {{p:form=Person&r=1|t:Edit Person|E|s AS link}}
 
+  # Function Columns
+  {{getFullname(pId) => fullname AS function}}
+
+  # Function Columns > direct tt_content output
+  {{getFullname(pId) AS function}}
+
 Leading and trailing spaces inside curly braces are removed.
 
 * ``{{ SELECT "Hello World"   }}`` becomes ``{{SELECT "Hello World"}}``
@@ -421,10 +427,13 @@ General note: using this type of variables is only the second choice. First choi
 :ref:`access-column-values`) - using the STORE_RECORD is more portable cause no renumbering is needed if the level keys change.
 
 
-.. _`link-column-variables`:
+.. _`link-function-column-variables`:
 
-Link column variables
----------------------
+Link/Function column variables
+------------------------------
+
+Link column
+^^^^^^^^^^^
 
 These variables return a link, completely rendered in HTML. The syntax and all features of :ref:`column-link` are available.
 The following code will render a *new person* button::
@@ -435,7 +444,38 @@ For better reading, the format string might be wrapped in single or double quote
 
   {{"p:form&form=Person|s|N|t:new person" AS link}}
 
-These variables are especially helpful in:
+
+Function column
+^^^^^^^^^^^^^^^
+
+These variables execute a qfqFunction::
+
+  // Report with qfqFunction. Subheader: getFullname
+  render = api
+  10 {
+      sql = SELECT CONCAT(lastName, ', ', firstName) AS _fullname
+              FROM Person
+              WHERE id = {{pId:R0}}
+  }
+
+  // Usage function column
+  {{getFullname(pId) => fullname AS function}}
+  {{SELECT '{{fullname:RE}}'}}
+
+Usually it is preferred to get the output from a function without using the variable {{_output:RE}}::
+
+  // Report with qfqFunction. Subheader: getFullname
+  render = api
+  10 {
+      sql = SELECT CONCAT(lastName, ', ', firstName)
+              FROM Person
+              WHERE id = {{pId:R0}}
+  }
+
+  {{getFullname(pId) AS function}}
+
+
+These two column variables are especially helpful in:
 
 * `report`, to create create links or buttons outside of an SQL statement. E.g. in `head`, `rbeg`, ...
 * `form`, to create links and buttons in labels or notes.
-- 
GitLab