Check multiple variables with single action

Check multiple variables with single action

Please excuse me if this question has already been answered. I have a pages that has 20 date fields on it that each need to run through a date validation. I would very much like to build one single action that performs this validation and automatically updates the Error_Message field. Then I use a For loop that will send a different one of the dates into the action until they have all gone through it. My question is this, is there anyway to build a for loop that I can use to send different variables into it depending on the number loop that it is on? My variables are called Start1 or Stop1, and both sets go up to 10. I'd like to be able to use something like this to send the variable to the action:

For (i=1;i<=10;i++) { Action(EditRecord1.Medication.Start+i;

and use that to send the variables. Is there a way to do this, or will I have to create a seperat action node for each date on the page?


Hi Joshua,


To avoid the replication of the action execution and validation of each variable, you could also do the following:

  1. Create a Structure in your eSpace with a DateTime field only (let's call it sDateTime);
  2. On your screen, create two local variable - a Record and a ListRecord both of type sDateTime;
  3. For each of your dates, assign it's value to the Record.DateTime field and append this record to the ListRecord - Use the List Append built-in function for that (see the ListAppend documentation in the Service Studio Online Help);
  4. Use a foreach node to iterate the ListRecord and execute your validation;

Best Regards,


Daniel Lourenço