Is there a way to get the first value from a Forms Collection for use in the Process Modeler. For example, if I have collection named User_Info, and Last_Name is a required field, how do I get the last name of only the first user. Something like {/dataset/User_Info/Last_Name(1)}?
Question
Question
Answer
Thanks Nathan!
I figured out a way to gather the first value from a collection using jQuery. In the example below, both the collection and css class are named User_Information. I assign events to the User_Information collection so that whenever a Last, First name is entered, the first last name is retrieved and assigned to the Request_ID_Suffix field. I could not determine a good way to trigger (or hook into) the collections delete event, hence the generic click event.
// Set the request ID suffix function setRequestIDSuffix() { var idSuffix = $('.Last_First input').first().val().split(' ', 1)[0].replace(',', '').trim().toUpperCase(); var requestIDSuffix = $('.Request_ID_Suffix input'); requestIDSuffix.val(idSuffix); requestIDSuffix.text(idSuffix); requestIDSuffix.change(); } var userInformation= $('.User_Information'); userInformation.on('change', '.Last_First input', setRequestIDSuffix); userInformation.on('blur', '.Last_First input', setRequestIDSuffix); userInformation.on('click', setRequestIDSuffix);
Replies
Hey Josh,
There is no way currently to retrieve a single value from a multi-value variable from within the Process Modeler. Two alternatives could be to use Workflow, which can select the individual value, or maybe re-design the Form to have a Field for each Name value, rather than one for all of them.
I have let a member of the Forms team know about looking into this issue.