Retrieve SharePoint 2013 list items based upon dropdown selection

I have SharePoint 2013 on premise farm. I have 2 lists. Let's call them ListA and ListB. ListA is a calendar list and ListB is a custom list. I have a dropdown field in both these lists which has various Team names as selection. When user selects a team name from dropdown field in ListA, it should pull in or bring list items from ListB corresponding to the dropdown selection in ListA.

I understand this could be done via Knockout or JQuery. Anyone has done this or accomplished this?
LVL 1
Snehal RanaSenior SharePoint ConsultantAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IsaacSharePoint Client Side DeveloperCommented:
Hi,

What you are asking is called cascading drop down.  This can be done with spservices.  Here's a video on what you are asking?  Click Here
Snehal RanaSenior SharePoint ConsultantAuthor Commented:
I will test this out and post my update here. Looks like a good solution. Appreciate your response
IsaacSharePoint Client Side DeveloperCommented:
Great! I hope it works out for you.
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Snehal RanaSenior SharePoint ConsultantAuthor Commented:
I haven't finished implementing this and testing. I will do that today and post my feedback.
IsaacSharePoint Client Side DeveloperCommented:
Great! Good luck!  Let us know if you get stuck.
Snehal RanaSenior SharePoint ConsultantAuthor Commented:
Will do
Snehal RanaSenior SharePoint ConsultantAuthor Commented:
In your example it shows only 1 to 1 drop down cascading drop downs. I have a bit different scenario. I need to reference just 1 column and depending upon that I need to display values from 6 different fields. Does SPServices has that?
IsaacSharePoint Client Side DeveloperCommented:
Yes it does.

Once you create your caml query and all the necessary filtering, you can display whatever column you want.  ex:

 $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Solutions POCs",
    CAMLViewFields: "<ViewFields><FieldRef Name='Name' /><FieldRef Name='Title' /></ViewFields>",
    CAMLQuery:"<Query>" +
                  "<OrderBy><FieldRef Name='Name' /></OrderBy>" +
                  //"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + Senior Associate + "</Value></Eq></Where>"
          // "<Where><Or><Geq><FieldRef Name='Title' /><Value Type='Text'>" +
             //  "<Today /></Value></Geq><IsNull><FieldRef Name='Expires' />" +
             //  "</IsNull></Or>" +
             // "</Where>" +
           "</Query>",
    completefunc: function (xData, Status) {

      var PrHtml=[];
      var SrHtml=[];

      $(xData.responseXML).SPFilterNode("z:row").each(function() {
      
      //Get Title
      var title = $(this).attr("ows_Title");     //<--Title is a column

      var name=$(this).attr("ows_Name").split(",");  //<-- Name is a colum
      
      //check for Senior Associate or Principal
      if (title=="Principal")
      {
        PrHtml.push("<a href='" +name[0]+ "'>" + name[1] + "</a>");
      }
      if (title=="Senior Associate")
      {
         SrHtml.push("<a href='" +name[0]+ "'>" + name[1] + "</a>");      
      }

      });

        $("#Principal").append(PrHtml.join(", ") ).css("padding","5px");
        $("#SrAssociate").append( SrHtml.join(", ") ).css("padding", "5px");

    }
  });

Open in new window


Check out this article:
http://www.sharepointhillbilly.com/Lists/Posts/Post.aspx?ID=5

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Snehal RanaSenior SharePoint ConsultantAuthor Commented:
Let me try this and post my update here. Appreciate your quick response
Snehal RanaSenior SharePoint ConsultantAuthor Commented:
Please close this question.  I have already accepted the solution from TheInnovator
IsaacSharePoint Client Side DeveloperCommented:
Thanks Snehal!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.