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 702529
In Process

The Archive Base Latest Questions

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

Maybe a very simple question. How can I put in this code <Query> <Where>

  • 0

Maybe a very simple question.

How can I put in this code

<Query>
   <Where>
      <Eq>
         <FieldRef Name="Judge_x0020_1" />
         <Value Type="Text">mr. R. Sanches</Value>
      </Eq>
   </Where>
</Query>

A variable from jscript in the area of the code where mr. R. Sanches is written. So my jScript contains a dynamic text variable I want to replace mr. R. Sanches with. See where it says THE JAVESCRIPT VAR underneath here:

jScript code I have

<script src="/JavascriptMODS/jPointLoader.js"></script>
<script src="/JavascriptMODS/jPoint.userprofile.js"></script>
<SCRIPT type=text/javascript>
            // Picks the userfield it is going to search with
            var user = jP.getUserProfile();
            var userinfspvalue = user.Department;

            // removes the non breaking space at the end of the departmentfieldcontent
            var removenonbreakingspace = String.fromCharCode(160);
            userinfspvalue = userinfspvalue.replace(removenonbreakingspace,'');
</script>

Userinfspvalue is the var I would like to use.

In the CAML query

<Query>
   <Where>
      <Eq>
         <FieldRef Name="Judge_x0020_1" />
         <Value Type="Text">Userinfspvalue</Value>
      </Eq>
   </Where>
</Query>

What is jP.getUserProfile()?

Code (i didnt create it).

/*
* name: jPoint.userprofile.js
* purpose: get user profile info from /_layouts/userdisp.aspx
* input: none
* visibility: public
* return: jP.UserProfile (object)
*   jP.UserProfile.Name
*   jP.UserProfile.Account
*   jP.UserProfile.Title
*   jP.UserProfile.EMail
*   jP.UserProfile.Notes
*   jP.UserProfile.AboutMe
*   jP.UserProfile.Picture
*   jP.UserProfile.Department
*   jP.UserProfile.JobTitle
*   jP.UserProfile.SipAddress
*   jP.UserProfile.SIPAddress
*
*   jP.UserProfile.FieldCount   //count of fields
*   jP.UserProfile.Fields       //array of field names
*   jP.UserProfile.Items[0].Name ... SipAddress
*
* use example: 
*   var usrprof = jP.getUserProfile(userID); //userID is optional 
*   var name = usrprof.Name; 
*   var email = usrprof.EMail;
*   var dept = usrprof.Department;
*/
(function(jP) {
    jP.getUserProfile = function (UserID) {
        var ProfileURL = jP.SiteURL+"/_layouts/userdisp.aspx";
        if(typeof UserID !== "undefined")
            ProfileURL = ProfileURL + "?ID=" + UserID;
        $.ajax( {
            type: "GET",    //jQuery ajax GET
            async: false,
            cache: false,
            url: ProfileURL, //userprofile url
            success: function(data){
                var tags = $(data).find("h3 > a");  //look for anchor in h3 tag
                if (tags.length > 0) {
                    var profile = {};
                    var fields = [];
                    var item = {};
                    $.each(tags, function(){
                        var name = this.name;   //name attritbute
                        var td = $(data).find("tr a[name='"+name+"']").parent().parent();  //get label td
                        var labelname = jP.strip(td.text());  //get label text as field name
                        if (labelname == "Picture") {
                            //special handling for Picture field
                            //concat attribute alt and src together
                            var img = td.siblings().find("img");
                            var val = img.attr("alt") + ";#" + img.attr("src");
                        }
                        else {
                            //get text of next td cell
                            var val = $.trim(td.siblings().text());
                        }
                        var intname = name.substr(name.indexOf("_")+1); //internal field name
                        if ($.inArray(intname, fields)==-1) {  //save as internal fieldname
                            fields.push(intname);
                            item[intname] = profile[intname] = val;
                        }
                        if ($.inArray(labelname, fields)==-1) { //save as label fieldname
                            fields.push(labelname);
                            item[labelname] = profile[labelname] = val;
                        }
                    });
                    //Set profile obj
                    profile["Fields"] = fields;
                    profile["FieldCount"] = fields.length;
                    profile["Items"] = [item];
                    //set UserProfile obj
                    jP["UserProfile"] = profile;
                }   
            }
        });
        return (jP["UserProfile"])
    }
})(jPoint);
  • 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-14T03:43:51+00:00Added an answer on May 14, 2026 at 3:43 am

    So a few things. This is client side; the browser executes this JScript (and as such I’m choosing to refer to it as JavaScript… good call re-tagging it)

    You’re using a JavaScript library called jPoint… but you’re trying to manipulate a CAML query.

    JPoint practices what is called Information Hiding by providing you with functions like getUserProfile() but the tradoff is that I don’t get the impression you can manipulate the CAML. As a matter of fact, judging by what I see in the implementation and by what I read on their web site, I think it doesn’t even CAML query but it just screen scrapes the HTML from profile pages.

    So in summary, I don’t think you’re trying to manipulate the CAML at all but rather need to find the appropriate jPoint function to use. If jPoint doesn’t have one, you’ll have to ditch it and use a more traditional solution.

    Why are you using jPoint instead of something a little more traditional, or server-side?

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

Sidebar

Ask A Question

Stats

  • Questions 378k
  • Answers 378k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Single quotes won't work because you also have a single… May 14, 2026 at 9:18 pm
  • Editorial Team
    Editorial Team added an answer I finally use TidTCPClient and made my POST request by… May 14, 2026 at 9:18 pm
  • Editorial Team
    Editorial Team added an answer Yes, the OpenID spec does not forbid discovery caching, and… May 14, 2026 at 9:18 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.