$list from text
(One intermediate revision by one user not shown) | |||
Line 11: | Line 11: | ||
<pre>add list to list(%my list, $list from text("list item 1, list item 2,list item 3, list item 4,list item 5,list item 6", ","), "Delete", "Global") | <pre>add list to list(%my list, $list from text("list item 1, list item 2,list item 3, list item 4,list item 5,list item 6", ","), "Delete", "Global") | ||
</pre> | </pre> | ||
+ | |||
The delimiter is the comma. The list from text function will treat each word separated by a comma as a list item. | The delimiter is the comma. The list from text function will treat each word separated by a comma as a list item. | ||
Line 16: | Line 17: | ||
Running the command and checking the debugger shows that each word has been designated as it's own list item. | Running the command and checking the debugger shows that each word has been designated as it's own list item. | ||
− | [[File: | + | |
+ | [[File:bcs1.jpg]] | ||
The [[$random list item| random list item]] and the [[$next list item|next list item]] function can then be used to fill fields with the list items. | The [[$random list item| random list item]] and the [[$next list item|next list item]] function can then be used to fill fields with the list items. |
Latest revision as of 23:02, 27 December 2016
list from text is a Data Function.
This function returns a list of items by separating the text into separate items based on a delimiter. Unlike the list from file function which needs a file to populate a list, this function allows you to type in your list items and designate a delimiter that sets each list item apart.
Text: The desired text being used to populated the list.
Delimiter: The delimiter for the list. (Can be any of the following and more: , . : ; " ' * etc.)
[edit] Example
add list to list(%my list, $list from text("list item 1, list item 2,list item 3, list item 4,list item 5,list item 6", ","), "Delete", "Global")
The delimiter is the comma. The list from text function will treat each word separated by a comma as a list item.
Running the command and checking the debugger shows that each word has been designated as it's own list item.
The random list item and the next list item function can then be used to fill fields with the list items.