kevhoff
Novice

Filter a List by a delimited field in a Form.

Hi All,

I need to restrict my users' access to certain business units based on their account.

I have 2 fields in the SharePoint list - Company, Requestors.

The Requestors field is a semi-colon separated list.

So I only want the Companies where the Current User's Email is in the Requestors field.

Company  Requestors

GBB110, bob.builder@bbc.co.uk;wendy.builder@bbc.co.uk

GBB100, bob.builder@bbc.co.uk

 

So if Wendy is logged on, she can only see GBB110 in the List Lookup.

I have tried many variations of fn-contains() with no success.

Yes, I have tried this using a table with multiple records for each Company, but the Business has rejected that solution based on their level of maintenance.

Any help is appreciated.

Regards,

K

0 Kudos
Reply
1 Reply
allan
Contributor

Re: Filter a List by a delimited field in a Form.

You will not be able to do it that way. There's no possibility to filter with something like "if Requestors field contains this value". You cannot do it in CAML, neither. Maybe with using OData request.
The best way to do it is to change your list so the key is the user (title field for instance) and the second field (company) should be a choice or a lookup.
0 Kudos
Reply