Hi @marial16 ,
Do you want to get current user's country and department?
If so, you need to use office365 users connector.
Firstly, please notice that Location data type is read-only in powerapps.
I suggest you use these fields: User(person or group), Country(lookup field), Division(lookup field)
1)You could use this formula to get current user's country:
First(Office365Users.SearchUserV2({searchTerm:User().Email}).value).Country
You could use this formula to get current user's department:
First(Office365Users.SearchUserV2({searchTerm:User().Email}).value).Department
2)To autofill drop down, you could set country drop down's Default:
First(Office365Users.SearchUserV2({searchTerm:User().Email}).value).Country
To autofill drop down, you could set department drop down's Default:
First(Office365Users.SearchUserV2({searchTerm:User().Email}).value).Department
3)The person drop down will be a little complex.
Firstly, you need to use combo box for this data type.
set the combo box's Items:
Choices(listname.personfieldname)
set the combo box's DefaultSelectedItems:
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: ".",
Picture: "."
}
Do not forget to connect with office365 User connector.
Best regards,