SharePoint's CAML query the "Created By" field with username
- by yellowblood
Hey, I have a form for administrators where they insert a user name ("domain\name") and the code gets and sets some information out of it.
It's a huge project and some of the lists contain the username as a string ("domain\name"), but some lists only count on the "Created By" column, which is auto-created.
I want to know what's the fastest way to query these lists using the username string. I tried to use the same query as the one I use for the first kind of lists and it obviously didn't work -
<Where><Eq><FieldRef Name='UserName'/><Value Type='Text'>domain\\username</Value></Eq></Where>
Thank you.