web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update label with the ...
Power Apps
Unanswered

Update label with the data from user search

(0) ShareShare
ReportReport
Posted on by 21

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.


Gallery for user choose.png
Label for Name display.png
Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,145 on at

    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

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    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,

  • Fedir_Redko Profile Picture
    21 on at

    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!


    After the user chooses person.png
    User leave empty field and cancel edit.png
    User open app for the first time .png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard