local!employees:{ {id:1, name:"john", department:"engineering"}, {id:2, name:"David boon", department:"engineering"}, {id:3, name:"mary reed", department:"sales"}, {id:4, name:"elizabeth cooper", department:"Finance"}, {id:5, name:"Daniel lewis", department:"Human resouce"}, {id:6, name:"kayne joy", department:"sales"} },
how to Fetch array of sales from department?
Discussion posts and replies are publicly visible
I'm not 100% clear on what you're asking, but assuming you want all list entries where the selected department is "sales", this might work:
index( local!employees, wherecontains( "sales", local!employees.department ), {} )
Hi Mike
after execution's getting below error
Expression evaluation error at function 'wherecontains' [line 12]: Invalid types, can only act on data of the same type (Text, Any Type)
Sorry - a manually-declared dictionary has weird typecastings on its properties (not seen when dealing with query results from the DB, usually). The following should iron that out:
index( local!employees, wherecontains( "sales", touniformstring(local!employees.department) ), {} )
It worked ! Thanks Mike