Dynamic Filter for Lookup field
Hi all,
I have a dynamic Lookup field. Each record in the "Sites" form has an "AMUser", and the current user sees a filtered list based on this. The lookup is configured like this:
- must have Site1
- (
- displayname = "Site"
- type = picklist
- values = Sites[AMUser == zoho.loginuser].ID
- displayformat = [ Site_name ]
- sortorder = ascending
- searchable = true
- width = 206px
- )
However, I'd like to nest this in an If statement so that if the current user has not been allocated any Sites, they see the full list. Something along the lines of:
- CountList = Sites[AMUser == zoho.loginuser].count()
- IF Countlist = 0 THEN
- {
- values = Sites.ID
- }
- Else
- {
- values = Sites[AMUser == zoho.loginuser].ID
- }
I'm not sure how to code this in the Form Definition and keep getting 'null' errors. Can anyone point me in the right direction?