When I use a named variable as a reference in another named variable it prevents delegation that a standard variable would allow.
e.g.
App.Formulas:
gblUserEmail = User().Email;
gblUserRecord = LookUp(SP_List, email = gblUserEmail); // Not Delegable
gblUserRecord2 = LookUp(SP_List, email = "joe.blogs@blah.com"); // Delegable
Using the named formula values in a LookUp when assigning a global variable also prevents delegation
Button.OnSelect:
Set(gblUserRecord3, LookUp(SP_List, email = gblUseremail)); // Non delegable
Tried to trick it using a 'with' statement (also does not work)
With(
{
tmpEmail:gblUseremail
},
Set(gblUserRecord3, LookUp(SP_List, email = tmpEmail)); // Non delegable
I'm assuming this is a bug, as it is not very helpful if the value cannot be referenced as part of lookups for other functionality?
Update:
I have found that it can be tricked initially, as shown below (expected output = Account). Definitely not clean code
