GET_PUBLISHED_VALUE

Use the GET_PUBLISHED_VALUE script function to retrieve the value of an object variable or PromptSet variable from a task.

Combine GET_PUBLISHED_VALUE with :SET to read the value of the following:

  • Object variable
  • PromptSet variable
  • Individual element in a PromptSet array

Combine GET_PUBLISHED_VALUE with :FILL to read a complete PromptSet array.

More Information:

Syntax

GET_PUBLISHED_VALUE (RunID, Variable name)

Parameters

  • GET_PUBLISHED_VALUE
    Retrieves a value from a task

  • RunID
    RunID of the task
    Format: script literal or script variable

  • Variable name
    Name of the object variable or PromptSet variable to retrieve, without the leading ampersand (&)
    Format: AE name
    Note: You can retrieve arrays from checklist and checkbox PromptSet elements. Include empty square brackets ([])at the end of the variable name when retrieving an array.

Examples

The following example activates an object and reads the object variable &VARIABLE1# in the activated task.

:SET &RUNID# = ACTIVATE_UC_OBJECT(&OBJ#,WAIT)
:SET &VAR# = GET_PUBLISHED_VALUE(&RUNID#,VARIABLE1#)
:PRINT "&&VARIABLE1# = &VAR#"

The following example reads the PromptSet variable &CHECKLIST1#, which has been defined as an array. The script only retrieves the value of the first array element.

:SET &RUNID# = ACTIVATE_UC_OBJECT(&OBJ#,WAIT)
:SET &VAR# = GET_PUBLISHED_VALUE(&RUNID#,"CHECKLIST1#[1]")
:PRINT "&&CHECKLIST1#[1] = &VAR#"
 

The following example retrieves the complete PromptSet array from the activated task. The script prints the individual PromptSet element values in the activation report. If the PromptSet array exceeds the size of the script array, the system only stores the elements that fit.

:DEFINE &ARRAY#, string, 10
:SET &RUNID# = ACTIVATE_UC_OBJECT(&OBJ#,WAIT)
:FILL &ARRAY#[] = GET_PUBLISHED_VALUE(&RUNID#,"CHECKLIST1#[]")
:SET &LEN# = LENGTH(&ARRAY#[])
:SET &VAR# = 1

:WHILE &VAR# LE &LEN#
:PRINT "&&ARRAY#[&VAR#] = &ARRAY#[&VAR#]"
:SET &VAR# = &VAR# + 1
:ENDWHILE

See also:

seealso

:FILL