Popular Help Content

No popular content.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Behavior: Joins the values of all nodes in a given nodeset, or an arbitrarily long list of strings, with a given string. This can be used to get all the values of a node in a repeat group.
  • Return: Joined string
  • Arguments: 
    • If joining a nodeset: A string to join the values of the nodeset with, and a nodeset.
    • If joining a list of strings:
      • First argument: A string to join the values in the list with
      • Subsequent arguments: List of strings to join
  • Syntax
    • Nodeset: join(text, my_nodeset)
    • List of strings: join(text, string_1, string_2, ..., string_n)
  • Examples
    • Nodeset: join(", ", /data/my_repeat/child_name)
    • List of strings: join(", ", /data/question1, /data/question2, /data/question3)

join-chunked

  • Behavior: Similar to join, but introduces a separator character after each N characters
  • Return: Joined string
  • Arguments: The separator String, size of each 'chunk', then list of values
  • Syntax
    • Nodeset: join-chunked(separator, chunk_size, my_nodeset)
    • List of strings: join(separator, chunk_size, string_1, string_2, ..., string_n)
  • Examples: Three values will be included in making a readable ID for a user, which has 4 characters separated by a '-'. The values are joined by join-chunked('-', 4, #form/value_one, #form/value_two, #form/value_three)" or by looping on a nodeset like  join-chunked('-', 4, /data/my_repeat/child_name)

lower-case

  • Behavior Transforms all letters in a string to their lowercase equivalents. 
  • Return: Updated string
  • Arguments: The string you want to transform.
  • Syntax: lower-case(text)
  • Example: lower-case("i AM a Test") -> "i am a test"
  • Since: This function is available on CommCare 2.19 and later

...