The problem is next I have a label which displays name of the user with assigned to him record in the Sharepoint list. Formula for the display is next: First(First(Filter(CreateTaskList, ID = ThisItem.ID)).'Assigned to').DisplayName - CreateTaskList is my Sharepoint list, Assigned to is a Person field in the list. Also I have a gallery and text input field which I use for the search of the users for assigning of the records when I'm updating it. So the point is that I wan't to display by default Users name to whon that record is already assigned but after the user starts to edit it and taps on the result from the gallery (user search) Label should be updated with the new users name. So than I can use that field for the update of the record.
If(!IsBlank(SelectedPerson),SelectedPerson.DisplayName, First(First(Filter(CreateTaskList, ID = ThisItem.ID)).'Assigned to').DisplayName))
This will check to see if SelectedPerson has a value - if yes (that means user has searched) then set value of label from the SelectedPerson object using SelectedPerson.DisplayName else get the value from the original logic
On Screen Visible you can ensure to set SelectedPerson to Blank()
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @RezaDorrani Thank you for your answer! Yes it helps now it's updating data after choose of the field in the Gallery. But it's apllying result to the all fields in the gallery. Is it possible to make it display the chosen by the user name only in the one records in which he was updating it? In the attachment I have added screenshot with outcome of the action of choose. Also one extra problem is update of the field in the case if the user leaves it empty. So if the user leave input field empty and than cancel edit the field will still be empty. I have added update of the context fot the cancel and update buttons but it works only if the data is input in the field. Thank you for the answer!