... |
... |
@@ -1,6 +1,6 @@ |
1 |
1 |
{{content/}} |
2 |
2 |
|
3 |
|
-Variables are used to dynamically insert the value of form fields, the results of actions, certain system properties and more. They are available to [[templates>>doc:Formcycle.UserInterface.FilesAndTemplates.WebHome]], most settings of [[actions>>doc:Formcycle.Designer.Workflow.Actions.WebHome]] and [[data base queries>>Formcycle.UserInterface.Data.DBQueries.WebHome]]. |
|
3 |
+Variables are used to dynamically insert the value of form fields, the results of actions, certain system properties and more. They are available to [[templates>>doc:Formcycle.UserInterface.FilesAndTemplates.WebHome]], most settings of [[actions>>doc:Formcycle.Designer.Workflow.Actions.WebHome]] and [[data base queries>>Formcycle.UserInterface.Data.DBQueries]]. |
4 |
4 |
|
5 |
5 |
As a common use case, consider a form allowing a user to enter their email address. When you would like to send an email to the address they entered, variables must be used. |
6 |
6 |
|
... |
... |
@@ -40,6 +40,22 @@ |
40 |
40 |
|
41 |
41 |
Example: The variable {{code language="none"}}[%tfEmail%]{{/code}} will take the value of the [[input field>>doc:Formcycle.Designer.Form.FormElements.Input]] named //tfEmail//. |
42 |
42 |
|
|
43 |
+=== Question element variables === |
|
44 |
+ |
|
45 |
+To access the values of [[select elements>>doc:Formcycle.Designer.Form.FormElements.Selection]] displayed as questions, you can use the following variables. Assume the select element is named //sel1//, has got 3 questions Q1, Q2, Q3 and 3 answers A1, A2, A3, and also assume these answers are selected: |
|
46 |
+ |
|
47 |
+{{table}} |
|
48 |
+|= - |= A1 |= A2 |= A3 |
|
49 |
+|Q1|☑|☐|☐ |
|
50 |
+|Q2|☑|☑|☐ |
|
51 |
+|Q3|☑|☑|☑ |
|
52 |
+{{/table}} |
|
53 |
+ |
|
54 |
+Then: |
|
55 |
+ |
|
56 |
+* //[%sel1%]// resolves to //A1;A1,A2;A1,A2,A3// |
|
57 |
+* //[%sel1_0%]// resolves to //A1//, //[%sel1_1%]// resolves to //A1,A2//, and //[%sel1_2%]// resolves to //A1,A2,A3// |
|
58 |
+ |
43 |
43 |
=== Special form elements === |
44 |
44 |
|
45 |
45 |
There are some special variables available: |
... |
... |
@@ -51,6 +51,8 @@ |
51 |
51 |
|
52 |
52 |
=== System variables === |
53 |
53 |
|
|
70 |
+{{id name="system"/}} |
|
71 |
+ |
54 |
54 |
{{panel monospace="true" title="Syntax"}} |
55 |
55 |
[%$<Name>%] |
56 |
56 |
{{/panel}} |
... |
... |
@@ -59,6 +59,10 @@ |
59 |
59 |
|
60 |
60 |
; [%$CLIENT_ID%] |
61 |
61 |
: The client ID of the client of the current form. |
|
80 |
+; [%$DEFAULT_MAIL_SENDER%] {{version major="7" minor="3"}}{{/version}} |
|
81 |
+: Returns the e-mail sender (system) for the configured mail server. If a separate mail server is configured under Client > Settings, these configuration will be used, otherwise the system e-mail server. |
|
82 |
+; [%$DEFAULT_MAIL_SENDERNAME%] {{version major="7" minor="3"}}{{/version}} |
|
83 |
+: Returns the sender name (system) for the configured mail server. If this is not configured, an empty string is returned. |
62 |
62 |
; [%$FORM_LINK%] |
63 |
63 |
: The URL of the current form. |
64 |
64 |
; [%$FORM_PROCESS_LINK%] |
... |
... |
@@ -69,16 +69,27 @@ |
69 |
69 |
: Returns the inbox name the form record currently resides in. |
70 |
70 |
; [%$FORM_INBOX_LINK%] |
71 |
71 |
: Returns the inbox link the form record currently resides in. |
|
94 |
+; [%$FORM_INVITE_LINK%] |
|
95 |
+: Returns the invitation link of the form. |
|
96 |
+; [%$FORM_HISTORY_HTML%] {{version major="7" minor="2" patch="0"/}} |
|
97 |
+: Returns the the history of a form record as (HTML) table. |
72 |
72 |
; [%$PROCESS_ID%] |
73 |
73 |
: The current process ID of the form record. |
74 |
|
-; [%$PROJECT_ALIAS%]"}} |
|
100 |
+; [%$PROJECT_ALIAS%] |
75 |
75 |
: The alias of the current form. |
76 |
76 |
; [%$PROJECT_ID%] |
77 |
77 |
: The form ID of the current form. |
78 |
|
-; [%$PROJECT_NAME%] |
79 |
|
-: The name of the current form. |
|
104 |
+; [%$PROJECT_TITLE%] |
|
105 |
+: As of version 7, [%$PROJECT_NAME%] is now called [%$PROJECT_TITLE%] . |
|
106 |
+: The title of the current form. |
80 |
80 |
; [%$RECORD_ID%] |
81 |
81 |
: The ID of the current form record. |
|
109 |
+; [%$RECORD_READ%] |
|
110 |
+: Whether the current form record was read. Evaluated as a Boolean, i.e. true or false. |
|
111 |
+; [%$RECORD_UNREAD%] |
|
112 |
+: Whether the current form record was not read. Evaluated as a Boolean, i.e. true or false. |
|
113 |
+; [%$RECORD_ATTR.<customAttrKey>%] |
|
114 |
+: Read user-defined form record attributes (e.g. [%$RECORD_ATTR.loopCount%]). This allows values to be stored on the form record and accessed in any action. |
82 |
82 |
; [%$SOURCE_SERVER%] |
83 |
83 |
: The name of the server that has provided the current form, either the name of the {{fserver/}} or the local server. |
84 |
84 |
; [%$SOURCE_SERVER_URL%] |
... |
... |
@@ -87,6 +87,16 @@ |
87 |
87 |
: The ID of the current state. |
88 |
88 |
; [%$STATUS_NAME%] |
89 |
89 |
: The name of the current state. |
|
123 |
+; [%$STATUS_TYPE%] |
|
124 |
+: The type of the current state. These four values are possible: //RECEIVED// , //SAVED//, //ERROR// and //CUSTOM// (Custom status created by user). |
|
125 |
+; [%$TRIGGER.actionName%] |
|
126 |
+: The name of the action of the providing event. |
|
127 |
+; [%$TRIGGER.taskName%] |
|
128 |
+: The name of the task where the action of the event is located. |
|
129 |
+; [%$TRIGGER.triggerName%] |
|
130 |
+: The name of the event where the action of the event is located. |
|
131 |
+; [%$COUNTER_CLIENT.<name of the counter>%] |
|
132 |
+: The current value of a client [[counter>>doc:Formcycle.UserInterface.Data.Counter]]. |
90 |
90 |
|
91 |
91 |
==== System variables with parameters ==== |
92 |
92 |
|
... |
... |
@@ -114,8 +114,32 @@ |
114 |
114 |
{{/html}} |
115 |
115 |
|
116 |
116 |
|
117 |
|
-User variables may be used in [[actions>>doc:Formcycle.Designer.Workflow.Actions.WebHome]], [[templates>>doc:Formcycle.UserInterface.FilesAndTemplates.WebHome]], [[data base queries>>Formcycle.UserInterface.Data.DBQueries.WebHome]] or directly in [[form elements>>Formcycle.Designer.Form.FormElements.WebHome]] for prefilling the form (see [[figure>>||anchor="fig_prefill_user_variables"]]). |
118 |
118 |
|
|
161 |
+{{html wiki="true"}} |
|
162 |
+<div class='xm-figure xm-float-right xm-clear-h2' data-alt='Using user variables to prefill form fields with data of the logged in user.'><div class='xm-figure-inner' style='width:310px'>{{lightbox image='prefill_user_variables_en.png' width='300' group='$height' group='$group' title='Using user variables to prefill form fields with data of the logged in user.'/}}<div class='xm-figure-caption'>Using user variables to prefill form fields with data of the logged in user.</div></div></div> |
|
163 |
+{{/html}} |
|
164 |
+ |
|
165 |
+ |
|
166 |
+ |
|
167 |
+{{html wiki="true"}} |
|
168 |
+<div class='xm-figure xm-float-right xm-clear-h2' data-alt='Using user variables to prefill form fields with data of the logged in user.'><div class='xm-figure-inner' style='width:310px'>{{lightbox image='prefill_user_variables_en.png' width='300' group='$height' group='$group' title='Using user variables to prefill form fields with data of the logged in user.'/}}<div class='xm-figure-caption'>Using user variables to prefill form fields with data of the logged in user.</div></div></div> |
|
169 |
+{{/html}} |
|
170 |
+ |
|
171 |
+ |
|
172 |
+ |
|
173 |
+{{html wiki="true"}} |
|
174 |
+<div class='xm-figure xm-float-right xm-clear-h2' data-alt='Using user variables to prefill form fields with data of the logged in user.'><div class='xm-figure-inner' style='width:310px'>{{lightbox image='prefill_user_variables_en.png' width='300' group='$height' group='$group' title='Using user variables to prefill form fields with data of the logged in user.'/}}<div class='xm-figure-caption'>Using user variables to prefill form fields with data of the logged in user.</div></div></div> |
|
175 |
+{{/html}} |
|
176 |
+ |
|
177 |
+ |
|
178 |
+ |
|
179 |
+{{html wiki="true"}} |
|
180 |
+<div class='xm-figure xm-float-right xm-clear-h2' data-alt='Using user variables to prefill form fields with data of the logged in user.'><div class='xm-figure-inner' style='width:310px'>{{lightbox image='prefill_user_variables_en.png' width='300' group='$height' group='$group' title='Using user variables to prefill form fields with data of the logged in user.'/}}<div class='xm-figure-caption'>Using user variables to prefill form fields with data of the logged in user.</div></div></div> |
|
181 |
+{{/html}} |
|
182 |
+ |
|
183 |
+ |
|
184 |
+User variables may be used in [[actions>>doc:Formcycle.Designer.Workflow.Actions.WebHome]], [[templates>>doc:Formcycle.UserInterface.FilesAndTemplates.WebHome]], [[data base queries>>Formcycle.UserInterface.Data.DBQueries]] or directly in [[form elements>>Formcycle.Designer.Form.FormElements.WebHome]] for prefilling the form (see [[figure>>||anchor="fig_prefill_user_variables"]]). |
|
185 |
+ |
119 |
119 |
{{panel monospace="true" title="Syntax"}} |
120 |
120 |
[%$<user object>.<attribute>%] |
121 |
121 |
{{/panel}} |
... |
... |
@@ -122,7 +122,7 @@ |
122 |
122 |
|
123 |
123 |
There are three user objects available which can be used to access information about the user (user profile). If a user variable is being used without any attributes (e.g. [%$USER%]), all user information will be returned in [[JSON>>https://de.wikipedia.org/wiki/JavaScript_Object_Notation]] format. |
124 |
124 |
|
125 |
|
-For sensible use of the user variables it is necessary to enable [[form login>>doc:Formcycle.UserInterface.MyForms.Access.WebHome||anchor="form_login"]]. If this is not configured the user object will be set to an anonymous user. |
|
192 |
+For sensible use of the user variables it is necessary to enable [[form login>>doc:Formcycle.UserInterface.MyForms.Access||anchor="form_login"]]. If this is not configured the user object will be set to an anonymous user. |
126 |
126 |
|
127 |
127 |
|
128 |
128 |
==== User objects ==== |
... |
... |
@@ -237,6 +237,8 @@ |
237 |
237 |
|
238 |
238 |
=== Action variables === |
239 |
239 |
|
|
307 |
+{{id name="action"/}} |
|
308 |
+ |
240 |
240 |
{{panel monospace="true" title="Syntax"}} |
241 |
241 |
[%$<actionName>.<returnValue>%] |
242 |
242 |
{{/panel}} |
... |
... |
@@ -247,9 +247,21 @@ |
247 |
247 |
|
248 |
248 |
; [%$<actionName>.SUCCESS%] |
249 |
249 |
: Whether the action could be processed successfully. Evaluates to a boolean, ie. true or false. |
250 |
|
-; [%$<actionName>.COUNT%] |
251 |
|
-: The number of results. Evaluates to an integer value. |
252 |
252 |
; [%$<actionName>.RESULT%] |
253 |
253 |
: A single return value. Evaluates to a string value. |
254 |
254 |
; [%$<actionName>.RESULT[<Index>].<Identifier>%] |
255 |
255 |
: Certain actions may return more than one result, corresponding to a //List<Map<String,String>>// in Java. The index and identifier is set by the corresponding action implementation and cannot be changed. This is used mostly by custom plugins when multiple values need to be returned. |
|
323 |
+ |
|
324 |
+The following action variables are __not__ supported in the old workflow: |
|
325 |
+ |
|
326 |
+; [%$<actionName>.ERROR_CODE%] |
|
327 |
+: In case of error the thrown error code of the action. |
|
328 |
+; [%$<actionName>.ERROR_MESSAGE%] |
|
329 |
+: In case of error the thrown error message of the action. |
|
330 |
+ |
|
331 |
+In the new workflow, the number of elements of JSON arrays can be queried from variable values with //.length()//, e.g.: **[%$Database query.RESULT.rows.length()%]** |
|
332 |
+ |
|
333 |
+The following action variable is __only__ supported in the old workflow: |
|
334 |
+ |
|
335 |
+; [%$<actionName>.COUNT%] |
|
336 |
+: The number of results. Evaluates to an integer value. |