Skip to main content

Search

Check Field

Comments

7 comments

  • Nicole Geier

    I have found an article of Christof Nussbaumer and tried

    [[@Web.QueryList('Feedbacks', '<Where><And><Eq><FieldRef Name="Employee" LookupId="TRUE" /><Value Type="Lookup">116</Value></Eq><Eq><FieldRef Name="Year" LookupId="TRUE" /><Value Type="Choice">1</Value></Eq></And></Where>',100, 'ID','Scope="Recursive" ')]]

     

    as result I don't get any entries, I get only 

    0
  • Christof Nussbaumer

    Hi Nicole Geier

     

    If you need just one fieldvalue of multiple items as result you can use GetValuesForQuery and loop over the returned array as I answered in this post to concatenate or sum the result: Using QueryList in Skybow Forms

     

    Try to use the CAML query from your own answer above with the GetValuesForQuery function and loop over the returned values described in the answered post.

    0
  • Nicole Geier

    Hi Christof Nussbaumer

     

    thank you for your answer

     

    I have done the following:

    [[@Web.GetValuesForQuery('Feedbacks', '<Where><Eq><FieldRef Name="Employee" LookupId="TRUE" /><Value Type="Lookup">116</Value></Eq></Where>','Points','Scope=Recursive')]]

     

    The columns points is a number field and I want all points from all year.

     

    With the expression above I only geht the following:

     

    My problem is that I don't get any values. 

    Please remark that I have a folder structure in the background. Without folder structure this expression works. 

     

    Kind regards

    Nicole

    0
  • Christof Nussbaumer

    Nicole Geier

    make sure you set the scope property in quotes - like this: ...</Where>','Points','Scope="Recursive"')]]

    0
  • Nicole Geier

    Hi Christof Nussbaumer

     

    yes I have done this, but still no result.

     

    What is interesting if I change the impression to this:

    [[@Web.GetValuesForQuery('Feedbacks', '<Where><Eq><FieldRef Name="Employee" LookupId="TRUE" /><Value Type="Lookup">116</Value></Eq></Where>','ID','Scope="Recursive"')]]

     

    Change the column from points to ID --> I get as result 48. But the ID of the entry which I'm searching is 51.

     

    Kind regards

    Nicole

    0
  • Patric Schielke

    Nicole Geier have you tried with another Value type. You use "Lookup" but you pass the ID integer value only and you also set LookupId to true. I believe you must change the value type to "Integer", like this:

     

    [[@Web.GetValuesForQuery('Feedbacks', '<Where><Eq><FieldRef Name="Employee" LookupId="TRUE" /><Value Type="Integer">116</Value></Eq></Where>','ID','Scope="Recursive"')]]

    0
  • Nicole Geier

    Hi Patric Schielke,

     

    thank you for your answer, but also your code doesn't work properly for my use case.

     

    I solved it with this expression:

    [[@Web.QueryList("Feedbacks", "<Where><Eq><FieldRef Name='Employee' /><Value Type='Lookup'>test</Value></Eq></Where>", 99, "Title", "Scope=Recursive")]][0]["Title"]

     

    Kind regards

    Nicole 

    0

Please sign in to leave a comment.