Can someone help me please?
I have a entity on which I store knowledge levels of our users. Therefore I created a lookup from the users table in my knowledge level entity, called mdw_id.
Now I am creating a PowerApp in which the users can add knowledge by themselves. I got it all working if they must select their own user id out of the created dropdown list. However I don't want them to select their own user id, I want this stored (on the background) by default to the current logged in user. The User() is working, because I have it somewhere on that same page. But it is not working for that mdw_id field.
On the "newLanguage" form I have now 3 fields. The mdw_id which is a lookup field in Users, the language which is a lookup field in the Language entity and a knowledge level. As said it is working like this. But I want the mdw_id filled by default.
If I select the user via the dropdown, it is shown and stored as "Lastname, Firstname".
I set up the DataCardValue of the DataCard mdw_id like:
DefaultSelectedItems:
If( NewLanguage.Mode = FormMode.New;
{ Value : User().fullname };
Parent.Default )
In the formula editor box I see User().fullname = Firstname Lastname. And if I run the app it is also shown the value FirstName Lastname. However it is giving also an error saying that value should be an entity item.
If I change the { Value : User().fullname } to { Value : "Lastname, Firstname" } it is showing the same error.
I have tried to set the { Value : First(Filter(Users; domainname = User().Email)) } but that is not giving any result. I guess it has to do with the First statement is giving a full User entity. I guess it must know which field out of this entity should be taken.
Can someone provide me with the correct solution?
Thanks!