Home › Forums › Cascading dropdowns › Cascading Dropdown Filter by Lookup
Tagged: cascading dropdowns, Filter, REST filter
- This topic has 5 replies, 2 voices, and was last updated 3 years, 8 months ago by Alexander Bautz.
-
AuthorPosts
-
-
March 11, 2021 at 16:17 #32977
Hey Alex,
I’ve added a cascading dropdown to populate options in my select field and configured the Set field value to auto-populate 2 person fields.
[{"from":"Leader/Name","to":"Leader"},{"from":"Rep/Name","to":"Rep"}]
I also want to filter my select field options by a specific Org but this field is a lookup and seems to be causing my issue.
Here’s the filter I tried to use:
{"filterField":"Org/Title","filterValue":"MyOrgValue","operator":"eq"}
but no values are returned.
- Am I missing something, or can I not use a lookup field value in the REST filter?
- Can the ability to filter by a lookup field value be added to the REST filter feature?
I can filter the select field options using a CAML, but then my person fields do not populate – presumably because I’m no longer using REST 😐
Thx,
Brian -
March 11, 2021 at 18:30 #32979
Hi,
Your “from” field must be the fieldinternal name of the field – so maybe only “Leader” and “Rep” and not “Leader/Name” or “Rep/Name”. You can find the fieldinternal names by going to the list and look at the Fields tab in the DFFS configuration.The same for your “Org” field – use the internal name in “filterField” value. The “filterValue” in your snippet is the actual text “MyOrgValue” – were you planning to use a variable? – if “MyOrgValue” is actually a variable from your Custom JS you must not use quotes around it.
Alexander
-
March 11, 2021 at 22:51 #32981
Hi Alexander,
I should clarify 🙂
- Leader/Name and Rep/Name reference lookup fields where Leader and Rep are the internal names of the fields and Name is the property I want to return (i.e. account value for the person)
- MyOrgValue is a placeholder I only included in my post, but I am using the actual Org value in my cascading dropdowns filter
When I remove the filter, the Set field value works as expected. The Leader and Rep person fields populate with the respective Name values and resolve to the correct employees, when a selection is made.
As a test, I added a reference to the Org value in the Set field value array, and it also works as expected and populates the text field Test with the appropriate Org value associated with the select field choice.
[{"from":"Leader/Name","to":"Leader"},{"from":"Rep/Name","to":"Rep"},{"from":"Org/Title","to":"Test"}]
However, when I apply the following filter
{"filterField":"Org/Title","filterValue":"MyOrgValue","operator":"eq"}
no values are returned to populate the select field options, and the debug states the following error.
*** Please note that this debug panel cannot determine if the fieldname: "Title" in the lookup list is correct. *** If you are not getting the options you expected, verify the FieldInternalName: "Title" in the lookup list: {list guid}
- This reply was modified 3 years, 8 months ago by Brian Bonner.
-
March 12, 2021 at 16:22 #32994
Thanks for the clarification – I actually forgot that I had support for using fin/prop in the “from” field… – I’ll get that in the user manual!
I don’t currently have support for using this format in the filterField property. Have you tried using only “Org”?
If that doesn’t work I’ll look into it and see what I can do.
Alexander
-
March 12, 2021 at 23:29 #32998
I tried just Org in the filterField property as you suggested, but no options are return and Debug states same error I posted previously.
{"filterField":"Org","filterValue":"MyOrgValue","operator":"eq"}
Thank you for responding so quickly 🙂
I do think adding support for fin/prop format in filterField property would be very helpful, as you have time to explore.
Thx,
Brian -
March 14, 2021 at 15:09 #33018
I have fixed this issue in the latest release: https://spjsblog.com/2021/03/14/dffs-package-updated-to-v4-4-5-19/
Let me know how it works out.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.