Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 803891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:49:51+00:00 2026-05-14T23:49:51+00:00

Hey, I have a form for administrators where they insert a user name (domain\name)

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:49:52+00:00Added an answer on May 14, 2026 at 11:49 pm

    There are two different “Created By” fields, one for all items and one specifically for document libraries (“Document Created By”). The internal name for the “Created By” field is “Author”, so <FieldRef Name='Author'/> would be the best start. The second field, which is the author of the actual file in a document library, has an internal name of “Created_x0020_By”. Judging from your scenario I have a feeling you’ll only need the former, but the latter is good to know anyway, because the data stored in them is different.

    “Created By” is a user field, so the string version of its data is ID;#Full Name. Meanwhile, “Document Created By” is a text field for a single line of text, and its data is stored as the actual username (with domain, if applicable). So your above query would work in the case of a document library and searching on <FieldRef Name='Created_x0020_By'/>. If you wanted to search on the “Created By” field, however, you’ll have to be a bit trickier, but you should be able to accomplish it by referencing the user’s SharePoint ID. The following is an example of a different User field query that I am using, for comparison.

    <Eq><FieldRef Name='AssignedTo' /><Value Type='Integer'><UserID Type='Integer' /></Value></Eq>
    

    This specifically filtered out the current user. To use it for your purposes, replace ‘AssignedTo’ with ‘Author’ and <UserID Type='Integer' /> with the ID of the user in question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey I have this code that sends an email with some data sent by
hey, well I have this form <form method=POST action=''> <input type=hidden name=op value=download1> <input
Hey I have downloaded one of the xml editors from some site. But don't
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Hey I have this code but it doesn't work because it is expecting a
Hey, I'm just wondering if it's possible to have a form in html do
Hey guys I have a system where there is one form for each friend
Hey guys I have a simple create method with some validations and whenever the
Hey guys, if anybody can help me out i'd love it... What i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.