Search code examples
formulainfopath2010

InfoPath Formula in Rules


I'm new to writing formulas in infopath and can't see what I'm doing wrong with the following:

if (contains(userName(), "\"))
{
substring-after(userName(), "\")
}
else
}
 userName()
}

The above is erroring on the first brace

I can write 2 rules to achieve the same thing but would like to use the above approach if it can be done!?

This a form load rule in infoPath 2010


Solution

  • Found this which seems to explain it, in case anyone else has the same issue...

    http://blogs.msdn.com/b/infopath/archive/2006/11/27/conditional-default-values.aspx