1 Reply Latest reply on Aug 12, 2016 4:16 AM by [email protected]

    Service Requests: Looping Form Fields for Multiple Entries / Custom Lists with Related Values

    louise.piper@it.ox.ac.uk Apprentice

      Has anyone created a service request offering for a requestor to make requests on behalf of multiple people that may or may not need the same thing?

      I have a few questions about this as the way I'm doing it feels very cumbersome so I'm hoping someone out there has done something similar.

       

      The way I am doing it currently is to ask the requestor how many users the request is for using a dropdown list. They select a number (1-10) and that number of 'User' fields is displayed for the requestor to complete.

      I then ask if all of these users want the same 'thing'. If Yes, a Custom List is displayed. If No, a separate Custom List is displayed against every User.

      An option on the form is to request to add or remove items from these Custom Lists so this logic is repeated again in order to do this.

      My form currently has more than 100 fields, most of which are the same fields replicated again and again for each user and displayed conditionally depending on the selections made by the requestor (and I'm still building it).

       

      So my question is, is there a better way to dynamically display these fields and lists?

      Is it possible to effectively create a loop in the form so that fields can be repeated without having to define each one for every possible scenario? e.g. if I select 3 users, 3 set of fields are displayed? Must this be a finite number?

       

      In addition to this, the values in the Custom Lists displayed to the requestor map to different values that are needed for Tasks.

      Is there a way to create a Custom List with 2 related values and but only 1 to be displayed to the user? It is not practical to create a Validation List in this instance as it will only ever be used for this request offering.

       

      e.g. In the following list, those prefixed AA are displayed on the form and those prefixed XX are displayed on the task:

      AAValue1; XXAAValue1

      AAValue2; XXAAValue2

      AAValue3; XXAAValue3

       

      Any ideas would be gratefully received!

      Thanks in advance

      Louise

        • 1. Re: Service Requests: Looping Form Fields for Multiple Entries / Custom Lists with Related Values
          louise.piper@it.ox.ac.uk Apprentice

          I've found a workaround for the Custom List that is not quite so complicated, using a dummy field to collate the information required from the List, using 'IsRegexMatch' and 'if, then, else' expressions to map to the required value and displaying that on the Task. It's still quite laborious and will have to be repeated for every user, however seems to work.

           

          So if the List is called 'List1' and

          List values are:

          ListValue1;

          ListValue2;

          ListValue3

           

          And values required for the Task are:

          TaskValue1;

          TaskValue2;

          TaskValue3

           

          The dummy (invisible) field has a default value expression of:

          (if IsRegexMatch(List1,  /ListValue1/i)

            then "TaskValue1;"

            else "") +

          (if IsRegexMatch(List1,  /ListValue2/i)

            then "TaskValue2;"

            else "") +

          (if IsRegexMatch(List1,  /ListValue3/i)

            then "TaskValue3;"

            else "")