In My Powerapp there is a Dropdown option (SP) which could be filled in by Powerapps.
I get an error Message when using this Statment, what is the issue?
If(User().Email = "mail@company.com" ; "res 1")

In My Powerapp there is a Dropdown option (SP) which could be filled in by Powerapps.
I get an error Message when using this Statment, what is the issue?
If(User().Email = "mail@company.com" ; "res 1")
Hi @KT03 ,
You need to specify the result of DefaultSelectedItems in a construct that conforms to your Items: property input.
In other words, if the Items: property is a table of values, then the result of DefaultSelectedItems must be in the format of a table, containing a record or multiple records from that table (not just a value).
So, let's say your Items: property is a collection called myCollection which looks like this;
| Value |
| res 1 |
| res 2 |
| res 3 |
And you want the default to be the first record, then your DefaultSelectedItems: property would be;
If(User().Email="mail@company.com", First(myCollection))
The control is already configured to show the column you want to display, so you must only specify the records/rows (not the column or field) and it will do the rest. If you wanted a different row, you could just use a lookup - or multiple rows, a filter that results in the rows you want selected - for example;
//LookUp Example (single default selected item)
If(User().Email="mail@company.com", LookUp(myCollection, Value = "res 2"))
//Filter Example (multiple default selected items)
If(User().Email="mail@company.com", Filter(myCollection, StartsWith(Value, "res")))
Hope this helps,
RT