Hi,
I have a table datasource with 2 columns,users( text) and adminstatus(bool)-true or false.
Table name is users.
i am trying to define if the logged user has the status true or not.
If yes, do something.
i used this but it s not working, ...
If (Lookup(datasource;user().Fullname in datasource.username; admin); ....;.....)
ANy help?
THANKS A LOT!
Solved! Go to Solution.
Try this ..
If(LookUp(datasource, username=User().FullName, adminstatus)=true, "Admin", "not Admin")
Thank you
-Srikanth
Hi @Masino,
We should avoid using names when filtering, as its possible that there may be more than one person with the same name, however email addresses can't be duplicates (MS Exchange doesn't allow it).
Something like this should work for you:
If(
Lookup(datasource; userEmailColumn = User().Email).adminstatus;
DoSomething();
OtherwiseDoSomethingElse()
)
Could you try modify that for your needs and let me know how you get on,
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
Error solved using iAm_ManCat's formula.
Now, if i use the lookup statement in an empty label it returns true, perfect. But when i use it with IF in the Dysplaymode propriety of the combobox, i can see it in view mode. Suggestions?
Well..i solved making a new label and hiding it. It will have a value based ont he output of the lookup formula, and so i just made:
F.Eks, If( label 5 = true ; Displaymode.edit;Displaymode.view)
Thanks!
Try this ..
If(LookUp(datasource, username=User().FullName, adminstatus)=true, "Admin", "not Admin")
Thank you
-Srikanth
Hi @Masino,
We should avoid using names when filtering, as its possible that there may be more than one person with the same name, however email addresses can't be duplicates (MS Exchange doesn't allow it).
Something like this should work for you:
If(
Lookup(datasource; userEmailColumn = User().Email).adminstatus;
DoSomething();
OtherwiseDoSomethingElse()
)
Could you try modify that for your needs and let me know how you get on,
Cheers,
Sancho
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
I got no errors this time, but i set my data as admin,and it doesnt work..
If(
LookUp(
Medarbejderne;
Navn_excel = User().FullName;
Admin) = true;
DisplayMode.Edit;
DisplayMode.View)
P.s. I am the only one with this name 😃
I am actually try to make a combox selectable for some users and others has to see only the default value.
It says that i cannot compare text and boolean values..actually it s true ^^!
@Masino ensure you have the same full name. You are saying there is a warning in comparision? can you share a screenshot of where the warning is? is your "Admin" field a boolean?
Than you
-Srikanth
Error solved using iAm_ManCat's formula.
Now, if i use the lookup statement in an empty label it returns true, perfect. But when i use it with IF in the Dysplaymode propriety of the combobox, i can see it in view mode. Suggestions?
Well..i solved making a new label and hiding it. It will have a value based ont he output of the lookup formula, and so i just made:
F.Eks, If( label 5 = true ; Displaymode.edit;Displaymode.view)
Thanks!
User | Count |
---|---|
255 | |
107 | |
85 | |
51 | |
43 |