Checking whether various form fields are filled in This is a customer information data entry form. First name and Last name are required. In addition phone number, e-mail and birth date are used to check the database for existing customers with the same information.

Either of these fields (phone, e-mail or birth date) can be empty or filled in. In order to validate against database I need to check if the user has filled each field in or not. 

Is there a way to refactor the code and still set a different property for each scenario?

The code looks like this: 

var sFirstName = Inputs.GetProperty("sFirstName");
var sLastName = Inputs.GetProperty("sLastName");
var sEmail = Inputs.GetProperty("sEmail");
var sPhone = Inputs.GetProperty("sPhone");
var sBirthDate = Inputs.GetProperty("sBirthDate");
var sCoAddress = Inputs.GetProperty("sCoAddress");
var sAddress = Inputs.GetProperty("sAddress");
var sZip = Inputs.GetProperty("sZip");
var sCity = Inputs.GetProperty("sCity");

if(!sFirstName || !sLastName){
    TheApplication().RaiseErrorText("First name and last name are required");           
}

if(!sEmail &amp;&amp; (!sCoAddress || !sAddress || !sZip || !sCity)){
    TheApplication().RaiseErrorText("Please enter either e-mail or postal address");
}
if(sEmail &amp;&amp; sBirthDate &amp;&amp; sPhone){
    Outputs.SetProperty("QueryAll","Y");
}
else if(sEmail &amp;&amp; sBirthDate &amp;&amp; !sPhone){
    Outputs.SetProperty("QueryEmailBday","Y");
}
else if(sEmail &amp;&amp; !sBirthDate &amp;&amp; sPhone){
    Outputs.SetProperty("QueryEmailPhone","Y");
}
else if(!sEmail &amp;&amp; sBirthDate &amp;&amp; sPhone){
    Outputs.SetProperty("QueryBdayPhone","Y");
}
else if(sEmail &amp;&amp; !sBirthDate &amp;&amp; !sPhone){
    Outputs.SetProperty("QueryEmail","Y");
}
else if(!sEmail &amp;&amp; sBirthDate &amp;&amp; !sPhone){
    Outputs.SetProperty("QueryBirthDate","Y");
}
else if(!sEmail &amp;&amp; !sBirthDate &amp;&amp; sPhone){
    Outputs.SetProperty("QueryPhone","Y");
}
else if(!sEmail &amp;&amp; !sBirthDate &amp;&amp; !sPhone){
    Outputs.SetProperty("QueryNameOnly","Y");
}
You could solve this by constructing your Queryname dynamically:

var queryName = "Query";
if ( sEmail ) queryName += "Email";
if ( sBDay  ) queryName += "BDay";
if ( sPhone ) queryName += "Phone";

if ( queryName == "Query" ) queryName = "QueryNameOnly";

Outputs.SetProperty( queryName,"Y" );


But for this you would have to be a little more strict with your Parameter-Names not changing between BDay and BithDate and no Specialcase for ALL