Hi
I am trying to display a trash icon in a gallery only if the logged in user is an admin and the Location field in SQL is set to 'Admin'.
I have a variable for the other users and their location is being stored in a variable called vUserLocation
if vUserLocation matches the Location column value e.g. 'Prague' then the trash icon should be visible for those records, but not any records which are 'Admin'
if vUserLocation matches the Location column value e.g. 'London' then the trash icon should be visible for those records, but not any records which are 'Admin'
if vUserLocation matches the Location column value e.g. 'Manchester' then the trash icon should be visible for those records, but not any records which are 'Admin'
I dont think the If statement will need to have Prague, London or Manchester hard coded, rather the vUserLocation would be used to lookup the SQL table values where the same text exists?
But the trash icon must always be visible if the logged in user is admin, regardless of which location is specified for Location - which I think I have working
The following works for me without an if statement, where the trash icon is always visible for the admin, but adding an if statement I cannot get the conditions to work, as soon as I add an If statement to the below my code messes up
LookUp(SqlTable, ThisItem.Location = "Admin" || Not(ThisItem.Location = "Admin" And vAdminEmail.AdminEmail = vUser, true)