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.
Hi @Fedir_Redko
For the label text property use
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()
OnVisible
UpdateContext({SelectedPerson:Blank()})
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Fedir_Redko ,
Could you please share a whole screenshot about your app's configuration?
Could you please share a bit more the 'Assigned to' column? Is it a Person column, which has enabled "Allow multiple selections" option?
Where do you put your Label? Within a Gallery?
Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:
Set the Text property of the Label (LabelValueHover_2) to following:
If(
!IsBlank(SelectedPerson),
First(SelectedPerson.'Assigned to').DisplayName,
First(First(Filter(CreateTaskList, ID = ThisItem.ID)).'Assigned to').DisplayName )
Set the OnSelect property of the Label (LabelValueHover_2) to following:
UpdateContext({ HidePeopleGallery: false, IsShowPeopleDetails: false, SelectedPerson: Blank() /* <-- Add this formula */ })
Set the OnVisible property of the current screen (which contains the Gallery ) to following:
UpdateContext({SelectedPerson: Blank()})
Best regards,
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!
User | Count |
---|---|
254 | |
112 | |
92 | |
48 | |
38 |