This list contains functions that can be used within a macro. A macro may contain one or more macro functions. A macro is delimited by a number sign (#) at the beginning and at the end. Everything between the number signs is treated as a macro expression, which is executed at run time.
Concatenates two strings.
value1 + value2
# '{' + $runLocale + '}'#
Result: {en-us}
Constructs an array out of the list of parameters.
array ( string_exp | array_exp { , string_exp | array_exp } )
#csv ( 'x1' , 'x2' , array ( 'a1' , 'a2' ) )#
Result: 'x1' , 'x2' , 'a1' , 'a2'
Constructs a comma separated values string from the elements of the array. Optionally the separator and quote strings can be specified. The default separator is a comma ( , ) and the default quote character is a single quote ( ' ).
csv ( array_exp [ , separator_string [ , quote_string ] ] )
#csv ( array ( 'a1' , 'a2' ) )#
Result: 'a1' , 'a2'
Surround the passed string with double quotes.
dq ( string_exp )
#dq ( 'zero' )#
Result: "zero"
Searches for elements of an array that match the pattern specified in the first argument. It returns an array with the elements that pass the pattern.
grep ( pattern_string , array_exp )
#csv ( grep ( 's' , array ( 'as', 'an', 'arts' ) ) )#
Result: 'as', 'arts'
Joins the elements of an array using the separator string.
join ( separator_string , array_exp )
# sq ( join ( ' | | ' , array ( 'as', 'an', 'arts' ) ) )#
Result: 'as | | an | | arts'
Prompt the user for a single value. Only the prompt_name argument is required. The datatype defaults to string when not specified. The prompt is optional when defaultText is specified. The text, when specified, will precede the value. A queryItem can be specified to take advantage of the Prompt Info properties of the query item. The trailing_text, when specified, will be appended to the value.
prompt ( prompt_name , datatype , defaultText , text , queryItem , trailing_text )
select . . . where COUNTRY_MULTILINGUAL.COUNTRY_CODE > #prompt('Starting CountryCode', 'integer', '10' )#
Result: select . . . where COUNTRY_MULTILINGUAL.COUNTRY_CODE > 10
Prompt the user for one or more values. Only the prompt_name argument is required. The datatype defaults to string when not specified. The prompt is optional when defaultText is specified. The text, when specified, will precede the list of values. A queryItem can be specified to take advantage of the Prompt Info properties of the query item. The trailing_text, when specified, will be appended to the list of values.
promptmany ( prompt_name , datatype , defaultText , text , queryItem , trailing_text )
select . . . where COUNTRY_MULTILINGUAL.COUNTRY IN ( #promptmany ( 'CountryName' ) # )
Result: select . . . where COUNTRY_MULTILINGUAL.COUNTRY_CODE IN ('Canada' , 'The Netherlands' , 'Russia')
select . . . from gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL, gosales.gosales.dbo.COUNTRY XX where COUNTRY_MULTILINGUAL.COUNTRY_CODE = XX.COUNTRY_CODE #promptmany('Selected CountryCodes', 'integer', ' ', ' and COUNTRY_MULTILINGUAL.COUNTRY_CODE IN (', '', ')' )#
Result: select . . . from gosales.gosales.dbo.COUNTRY_MULTILINGUAL COUNTRY_MULTILINGUAL, gosales.gosales.dbo.COUNTRY XX where COUNTRY_MULTILINGUAL.COUNTRY_CODE = XX.COUNTRY_CODE and COUNTRY_MULTILINGUAL.COUNTRY_CODE IN ('Canada' , 'The Netherlands' , 'Russia')
Surround the passed string with square brackets.
sb ( string_exp )
#sb ( 'abc' )#
Result: [abc]
Surround the passed string with single quotes.
sq ( string_exp )
#sq ( 'zero' )#
Result: 'zero'
Sorts the elements of the array in alphabetical order. Duplicates are retained.
sort ( array_exp )
#csv ( sort ( array ( 's3', 'a', 'x' ) ) )#
Result: 'a', 's3', 'x'
Splits a string or the string elements of the array into separate elements.
split ( pattern_string, string_exp | array_exp )
#csv ( split ( '::', 'ab=c::de=f::gh=i' ) )#
Result: 'ab=c' , 'de=f', 'gh=i'
#csv ( split ( '=' , split ( '::', 'ab=c::de=f::gh=i' ) ) )#
Result: 'ab' , 'c' , 'de' , 'f', 'gh' , 'i'
Search for a pattern in a string or in the string elements of an array and substitute the first occurrence of the found text with other text.
substitute ( pattern_string, replacement_string, string_exp | array_exp )
#sq ( substitute ( '^cn=', '***', 'cn=help' ) )#
Result: '***help'
#csv ( substitute ( '^cn=', '***', array ( 'cn=help' , 'acn=5' ) ) )#
Result: '***help' , 'acn=5'
#csv ( substitute ( 'cn=', '', array ( 'cn=help' , 'acn=5' ) ) )#
Result: 'help' , 'a5'
Removes duplicate entries from the array. The order of the elements is retained.
unique ( array_exp )
Example: #csv ( unique ( array ( 's3', 'a', 's3', 'x' ) ) )#
Result: 's3', 'a', 'x'
URL encodes the passed argument. Useful when specifying XML connection strings.
field_one=urlencode(prompt('userValue'))
urlencode(prompt('some_val'))
Result: %27testValue%27
Use the identity information of the current authenticated user to lookup values in the specified parameter map. Each individual piece of the user's identity (account name, group names, role names) is used as a key into the map. The unique list of values that is retrieved from the map is then returned as a string, where each value is surrounded by single quotes and where multiple values are separated by commas.
CSVIdentityName ( %parameter_map_name [ , separator_string ] )
#CSVIdentityName ( %security_clearance_level_map )#
Result: 'level_500' , 'level_501' , 'level_700'
Returns the pieces of the user's identity (account name, group names, role names) as a list of strings. The unique list of values is returned as a string, where each value is surrounded by single quotes and where multiple values are separated by commas.
CSVIdentityNameList ( [ separator_string ] )
#CSVIdentityNameList ( )#
Result: 'Everyone' , 'Report Administrators' , 'Query User'
Returns the passport.
CAMPassport ( )
#CAMPassport ( )#
Result: 111:98812d62-4fd4-037b-4354-26414cf7ebef:3677162321
Returns the pieces of the user's identity (account name, group names, role names) as a list of values separated by commas.
CAMIDList ( [ separator_string ] )
#CAMIDList ( )#
Result: CAMID("::Everyone"), CAMID(":Authors"), CAMID(":Query Users"), CAMID(":Consumers"), CAMID(":Metrics Authors")
Returns an array of the user's identities based on the identity type (account, group, or role). It can be used with the macro functions csv or join.
CAMIDListForType ( identity type )
[qs].[userRole] IN ( #csv ( CAMIDListForType ( 'role' ) ) # )
Result: [qs].[userRole] IN ( 'CAMID("::System Administrators")', 'CAMID(":Authors")' )