Lookup filter ID
Hello guys,
I made before a cascading lookup and it's working.
Anyway, now i want to made a lookup field who can filter per ID from another list:
Exemple :
In List A, i have a Parent element,
In List B, i have many Child element with S/N and an ID as a field text from my parent's list
In List C, i want to put my lookup field from my List B and get all concernate element's from my list B
I tryed to filtering per ID but not working
Any idea ?
I made before a cascading lookup and it's working.
Anyway, now i want to made a lookup field who can filter per ID from another list:
Exemple :
In List A, i have a Parent element,
In List B, i have many Child element with S/N and an ID as a field text from my parent's list
In List C, i want to put my lookup field from my List B and get all concernate element's from my list B
I tryed to filtering per ID but not working
Any idea ?
OK. So, you want to filter your lookup field results by a field. Here's how you do it:
1. Imputation (in List C) must be a plumsail lookup field. Delete and create if and as appropriate.
2. When you're creating the Imputation field (or if you have created it modify it via 'Manage plumsail lookups' button):
a. Click 'advanced settings'
b. You'll need to change the 'request items' query, here's my sample code:
c. Click Save.
1. Imputation (in List C) must be a plumsail lookup field. Delete and create if and as appropriate.
2. When you're creating the Imputation field (or if you have created it modify it via 'Manage plumsail lookups' button):
a. Click 'advanced settings'
b. You'll need to change the 'request items' query, here's my sample code:
Code: Select all
function (term, page) {
//get the value of the 'Id_Affaire' field that belongs to the current list (List C) . The field must be present on the form. If needed, you may hide it with CSS - ask if you need to.
var id_affaire = fd.field('Id_Affaire').value();
//if empty value, assign 0
if (!id_affaire) {
id_affaire = 0;
}
//draw attention to the $filter parameter. Id_Affaire is the internal name of Id_Affaire in List B, id_affaire is the variable defined above.
if (!term || term.length == 0) {
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$filter=(Id_Affaire eq " + id_affaire + ")&$orderby=Created desc&$top=10";
}
return "{WebUrl}/_api/web/lists('{ListId}')/items?$select=Id,{LookupField}&$orderby={LookupField}&$filter=(Id_Affaire eq " + id_affaire + ") and startswith({LookupField}, '" + encodeURIComponent(term) + "')&$top=10";
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests