Here is an updated version that handles all prompt set element types. I’ve put it in a JOBI to make it easy to re-use.
UC0.PREP_PROCES_PROMPTSET.JOBI
:PRINT "--- BEGIN UC0.PREP_PROCES_PROMPTSET.JOBI ---"
:SET &PPP_Hnd# = PREP_PROCESS_PROMPTSET("&PromptSet_Name#")
:SET &NumColumns# = GET_PROCESS_INFO(&PPP_Hnd#,COLUMNS)
:SET &NumRows# = GET_PROCESS_INFO(&PPP_Hnd#,ROWS)
:SET &Verbose_mode# = &Verbose_mode#
:SET &Obscure_text_input# = &Obscure_text_input#
:IF &NumRows# > 0
: SET &NumColumns# = GET_PROCESS_INFO(&PPP_Hnd#,COLUMNS)
:ELSE
: SET &NumColumns# = 0
:ENDIF
:SET &Counter# = 0
:PROCESS &PPP_Hnd#
: SET &Counter# = &Counter# + 1
! If this is the first element in the prompt set, begin the READ block.
: IF &Counter# = 1
: BEGINREAD
: ENDIF
: SET &PromptSet_Element_Variable# = GET_PROCESS_LINE(&PPP_Hnd#,1)
: SET &PromptSet_Element_CustomField# = GET_PROCESS_LINE(&PPP_Hnd#,2)
: SET &PromptSet_Element_Default# = GET_PROCESS_LINE(&PPP_Hnd#,3)
: SET &PromptSet_Element_Type# = GET_PROCESS_LINE(&PPP_Hnd#,4)
: SET &PromptSet_Element_DataSource# = GET_PROCESS_LINE(&PPP_Hnd#,5)
: SET &PromptSet_Element_Key# = GET_PROCESS_LINE(&PPP_Hnd#,6)
: SET &VarName# = STR_CUT(&PromptSet_Element_Variable#,1)
: SET &Caption# = &PromptSet_Element_CustomField#
: SET &Default# = &PromptSet_Element_Default#
: IF &PromptSet_Element_Type# <> "label"
: RESOLVE &Default# = "&Default#"
: ENDIF
: IF &Verbose_mode# = "YES"
: PRINT "Prompt set element details:"
: PRINT "Variable name : &&&PromptSet_Element_Variable#"
: PRINT "Custom field : &PromptSet_Element_CustomField#"
: PRINT "Default value : &PromptSet_Element_Default#"
: PRINT "Element type : &PromptSet_Element_Type#"
: PRINT "Data source : &PromptSet_Element_DataSource#"
: PRINT "Key : &PromptSet_Element_Key#"
: PRINT "Variable name without leading ampersand (&&): &VarName#"
: PRINT "Resolving variables in default value."
: PRINT "Resolved default: &Default#"
: ENDIF
: SET &InputCheck# = ""
: SET &InputHandling# = ""
: SWITCH &PromptSet_Element_Type#
: CASE "label"
: SET &Build_InputCheck_String# = "NO"
: PRINT "&Default#"
: CASE "integer"
: SET &Build_InputCheck_String# = "NO"
: SET &InputHandling# = "&InputHandling#N"
: CASE "text"
: SET &Build_InputCheck_String# = "NO"
: SET &InputHandling# = "&InputHandling#K"
: IF &Obscure_text_input# = "YES"
: SET &InputHandling# = "&InputHandling#D"
: ENDIF
: CASE "combo"
: SET &Build_InputCheck_String# = "YES"
: SET &Column_To_Read# = 1
: SET &InputHandling# = "&InputHandling#O"
: CASE "dynradiogroup"
: SET &Build_InputCheck_String# = "YES"
: SET &Column_To_Read# = 2
: CASE "dyncheckgroup"
: PRINT "Because check box groups are recreated here as combo boxes, it is possible to select only one value."
: SET &Build_InputCheck_String# = "YES"
: SET &Column_To_Read# = 2
: CASE "time"
: PRINT "Please enter a time in HH:MM format (24-hour clock)."
: SET &Build_InputCheck_String# = "NO"
: CASE "datefield"
: PRINT "Please enter a date in YYYY-MM-DD format."
: SET &Build_InputCheck_String# = "NO"
: CASE "timestamp"
: PRINT "Please enter a time stamp in YYYY-MM-DD HH:MM:SS format (24-hour clock)."
: SET &Build_InputCheck_String# = "NO"
: ENDSWITCH
: IF &Build_InputCheck_String# = "YES"
! Assemble list of possible values from element data source.
: SET &DS_Hnd# = PREP_PROCESS_VAR(&PromptSet_Element_DataSource#)
: PROCESS &DS_Hnd#
: SET &DS_Value# = GET_PROCESS_LINE(&DS_Hnd#,&Column_To_Read#)
: IF &InputCheck# = ""
: SET &InputCheck# = "'&DS_Value#'"
: ELSE
: SET &InputCheck# = "&InputCheck#,'&DS_Value#'"
: ENDIF
: ENDPROCESS
: CLOSE_PROCESS &DS_Hnd#
: ENDIF
! Because the :READ command accepts only specific variable names as the first arugment,
! the names of all of the prompt set variables that might be encountered must be
! hard-coded here, each with its own CASE clause in the SWITCH...ENDSWITCH block.
: SWITCH &VarName#
: CASE "INTEGER1#"
: READ &INTEGER1#, &InputCheck# , &Caption#, &Default#, &InputHandling#
: CASE "TEXTFIELD1#"
: READ &TEXTFIELD1#, &InputCheck# , &Caption#, &Default#, &InputHandling#
: CASE "COMBOBOX1#"
: READ &COMBOBOX1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "RADIOGROUP1#"
: READ &RADIOGROUP1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "CHECKGROUP1#"
: READ &CHECKGROUP1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "CHECKLIST1#"
: READ &CHECKLIST1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "TIME1#"
: READ &TIME1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "DATE1#"
: READ &DATE1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: CASE "TIMESTAMP1#"
: READ &TIMESTAMP1#, &InputCheck#, &Caption#, &Default#, &InputHandling#
: ENDSWITCH
: PRINT
! If this is the last element in the prompt set, end the READ block.
: IF &Counter# = &NumRows#
: ENDREAD
: ENDIF
:ENDPROCESS
:CLOSE_PROCESS &PPP_Hnd#
:PRINT "--- END UC0.PREP_PROCES_PROMPTSET.JOBI ---"
I also made a more complicated prompt set to test each element type.

The script that uses the JOBI looks like this:
:SET &Verbose_mode# = "NO"
:SET &Obscure_text_input# = "NO"
:SET &PromptSet_Name# = "UC0.PROMPT_SET-TEST2.PRPT"
:INC UC0.PREP_PROCES_PROMPTSET.JOBI
And the dynamically generated prompt set looks like this:

It’s not perfect. Check box groups and lists cannot be recreated correctly; and time, date, and timestamp fields are recreated as simple text input fields. Still, I think it should be good enough for simple prompt sets. Note that the captions for each field are being read from the Custom field in the prompt set. I simply copied the caption for each element to the custom field to make this possible. (For some reason, it’s not possible to read prompt set element captions using :PREP_PROCESS_PROMPTSET.)
#:prep_process_promptset #promptset #prpt #caautomicworkloadautomation #caautomicautomationengine