If statement within Add Record

If statement within Add Record

Does Zoho Creator not let you put an if statement within an Add Record function? I have coded my form so that when you submit it, a record is automatically added to another table using "Add Record". I want to put an if statement within this to specify different values of one of the fields based on another. See code below:

insert into Healthlink
[
    Customer_PO = input.Customer_PO
    DeliverToCode = input.Healthlink_Customer_Code
    if(input.Number_of_items  ==  "2")
{
ItemType2="S";

}
    else if(input.Number_of_items  ==  "3")
{
ItemType2="O";
}
]



// The code works fine without the if statement, but when I add it, I receive this error: " Improper Statement
Error might be due to missing ';' at end of the line or incomplete expression".