question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SPFilterDropdown CAMLQuery issue

See original GitHub issue

Hi,

I am working in SP-Online and tried to use the SPFilterDropdown function. The caml below seems to be OK as it is working in other tools. But for same reason it is not working with SPServices.

Environment:

  1. I have a Library called “Docs” with DocumentSets. I have added a Lookup field pointing to another List called “Processes”

2.) Within the List Processes I have created a LookUp field to “Docs” using the auto generated field “Related Process (Count Related)” and named it “RelatedDocSetCount”.

The Dropdown should only show entries where the column “RelatedDocSetCount” is 0. So used the code below but now my dropdown is empty. Any ideas?

$().SPServices.SPFilterDropdown({ relationshipList: "Processes", relationshipListColumn: "Title", columnName: "RelatedProcess", CAMLQuery: "<Eq><FieldRef Name='RelatedDocSetCount'/><Value Type='Lookup'>0</Value></Eq>", completefunc: null, debug: true });

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
theJetcommented, Mar 19, 2020

Thanks @sympmarc. I might try that. I was trying this on our test server which also couldn’t run workflows. When I tried to perform a workflow on our production site I got it to work, so I have a workflow setup to copy over the value in that lookup (count related) field to another field which I can then use in a calculated field to filter down my drop-down to just Departments with one or more measures.

I can’t tell you how much I appreciate you getting back to me.

0reactions
sympmarccommented, Mar 20, 2020

If the Measures column is multi-select, I’m not sure the filter you’re using will work. I think what might be returned in that case would be “”. It’s been a while since I used these functions. 😃 What version of SharePoint?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use spservices to run CAML query filter on Single Dropdown
SPFilterDropdown ! This works perfectly! //Filter the Category dropdown $().SPServices.SPFilterDropdown({ relationshipWebURL: "" ...
Read more >
SPFilterDropdown - SPServices
The SPFilterDropdown function allows you to filter the values available in a Lookup column using CAML against the Lookup column's source list.
Read more >
Using SPFilterDropdown to Reorder Options in a Dropdown ...
For my example above, I specify SortOrder as the relationshipListSortColumn, and set the CAMLQuery to give me all items where the Title does...
Read more >
how to format dates returned from SPServices ...
I'm using SPServices.SPFilterDropdown to populate a lookup column drop-down. The results are returned in this format: YYYY-MM-DD hh:mm:ss.
Read more >
Comments on: Using SPFilterDropdown to Reorder Options in ...
One issue I encountered with this: the (None) option appeared in my dropdown ... two conditions in the CAML Query for SPFilterDropdown and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found