I'm having strange issues using the above example to do the same thing. Specifically, my form has an area (i.e. "Section") that I wish only certain people (based on a SharePoint List of usernames) to see when they access the form.
My rule's condition is: AuthUsername [is not equal to] userName()
I have a field named 'username' that contains the value 'userName()' and I have also ensured that I have a secondary data connection that points to the SharePoint List that contains the list of usernames which are authorized to view that Section of the form. I also ensured that the secondary data connection has only the 'AuthUsername' checkbox checked.I did not check the checkbox for 'Store a copy of the data in the form template as I do not believe I need to do this. I also ensured that the checkbox to 'automatically retrieve the data from the form when the form is opened' is checked so that the variable is available for the rule to work.
When I go to the form and either edit or create a new item I cannot see that hidden section of the form that I should be able to view. My username within the SharePoint List that the secondary data connection retrieves has only the username but NOT the domain name (i.e. mjohn) but maybe I should include the domain name too? (i.e. DOMAIN\mjohn)?
Any help would be greatly appreciated. Funny thing is...I've done this in the past, many many times, successfully. That was a different job and a few years ago. I'm in a new work environment and I have no idea why it won't work now. err...
Phil