I have in many instances created a Workflow that re-creates a previously completed Forms process due to an error, accidental completion, etc. In my experience, the "Invoke Business Process" activity in Workflow is very difficult to use with large Forms. Selecting each Form variable one-by-one is terribly tedious and far too prone to missing something.
Once I have all the variable names, I can repopulate / recreate a Form using an Excel table to prepend the 'RetrieveBusinessProcessVariables' to the field name, saving a fair amount of time when repopulating Forms data. However, getting those variables initially is still problematic.
If someone has other suggestions on a way to easily get all of the variable names for a given Form easily, I am open to suggestions! My current approach is to use a stripped-down version of the Form with no pagination or special rules to worry about; just all of the fields right there. I then use this javascript code to populate a div in a Custom HTML field:
function getAllFieldVariables(){ $('li[attr]').each(function(){ // get the current field's variable name var attrName = $(this).attr('attr'); // determine if the current object is a table/collection, or a child of one var notCollection = $(this).attr('attrtype') != 'collection'; var notTable = $(this).attr('attrtype') != 'table'; var collectionName = $(this).parents('li[attrtype="collection"]').attr('attr'); var tableName =$(this).parents('li[attrtype="table"]').attr('attr'); // create the final variable name I will use to append var fieldVarName; // skip the actual table and collection variables, as I only need those as a prefix if (notTable && notCollection){ // if the current field is in a collection, variable name = collection.attr if (collectionName) fieldVarName = collectionName + '.' + attrName; // if the current field is in a table, variable name = table\attr else if (tableName) fieldVarName = tableName + '\\' + attrName; // else the variable name is just the attr value else fieldVarName = attrName; // append variable name to custom html div $('.variableNames').append(fieldVarName + '<br>'); } }); }
This mostly works pretty well. I get a newline-delimited list of all the field variable names on the Form, EXCEPT for tables.
I have been completely unable to figure out how to identify the actual field variable names for fields inside a table, such that I could use it in my Invoke activity (tableName\variableName).
For example, in this table, I need to be able to find the variable name (Single_Line_Field) for the field under the "single" header, but I cannot find it anywhere in the tables properties or attributes when using the browser development tools.
Anyone have any tips or suggestions for me?!