Cascading lookup problem
Posted: 20 Mar 2019
Hi Guys,
i am stuck with some issues while creating cascading lookups, and need your help.
First; i get the following error when adding a new item: Second; i get multiple choices in drop down lookups. Is it possible to filter out duplicates and show single entries? I have a two lists
1. Skills list 2. Talent list - list of users with their skills, this list have 4 lookup columns from the skills list (skill level, band, discipline, skill - all are text columns in skills list)
I would like to create a cascading lookup, cascading top to bottom
- skill level
- band
- discipline
- skill
I tried adding cascade to discipline and skill, however i get an error shown on the first screenshot, here is what i have in the request items:
function (term, page) {
var disciplineId = fd.field('Discipline').value();
if(!disciplineId){
disciplineId = 0;
}
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Discipline/Id&$orderby=Created desc&$expand=Discipline/Id&$filter=Discipline/Id eq " + disciplineId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Discipline/Id&$orderby={LookupField}&$expand=Discipline/Id&$filter=startswith({LookupField}, '" + term + "') and Discipline/Id eq " + disciplineId + "&$top=10";
}
Sincerely,
TK
i am stuck with some issues while creating cascading lookups, and need your help.
First; i get the following error when adding a new item: Second; i get multiple choices in drop down lookups. Is it possible to filter out duplicates and show single entries? I have a two lists
1. Skills list 2. Talent list - list of users with their skills, this list have 4 lookup columns from the skills list (skill level, band, discipline, skill - all are text columns in skills list)
I would like to create a cascading lookup, cascading top to bottom
- skill level
- band
- discipline
- skill
I tried adding cascade to discipline and skill, however i get an error shown on the first screenshot, here is what i have in the request items:
function (term, page) {
var disciplineId = fd.field('Discipline').value();
if(!disciplineId){
disciplineId = 0;
}
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Discipline/Id&$orderby=Created desc&$expand=Discipline/Id&$filter=Discipline/Id eq " + disciplineId + "&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField},Discipline/Id&$orderby={LookupField}&$expand=Discipline/Id&$filter=startswith({LookupField}, '" + term + "') and Discipline/Id eq " + disciplineId + "&$top=10";
}
Sincerely,
TK