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 / People Picker with Glo...
Power Apps
Unanswered

People Picker with Global Variable

(0) ShareShare
ReportReport
Posted on by 80

Hi,

I have custom list  with "Assigned To" column. I wanted to send email whenever add person to this field.  We cannot use the legacy Issue Tracking or Task list since I need PowerApps functionality in my custom list. 

 So I created "Assigned To" (People Picker field) custom filed and "Previous Assigned To Email" (string filed). 

I have to send the notification using flows whenever person is added/ replaced. 

 

Example -

When Person A added in “Assigned To” - Notification will go to Person A

When Person A  replaced by  To Person B in “Assigned To”. I have to send the notification both Person A and Person B. 

How can I hold the Previous "Assigned To" person email in in text box. 

 

Regards,

Abdul

 

 

 

Categories:
  • jhall Profile Picture
    636 on at

    When you issue an EditForm() on a record (assuming you're doing a model-app style form), you can follow that by assigning the current value of the field to a variable (e.g. Set(oldAssignedTo,AssignedTo.Text)).

    If the value of OldAssignedTo <> AssignedTo.Text when you do a Submit then you need to send two alerts.

  • azeesdinu Profile Picture
    80 on at

    HI Jihal,

    Thanks for your reply. I tried the same in my powerapps. I have used customise PowerApps screen from the custom list. 

    in App OnSelect event I set the value to variable like 

    Set(varAssignedTo, AssignedValueCard.Selected.Email) 

     

    in "Previous Email"filed Default formula - I trying to get the value from the varAssignedTo like

    If(varAssignedTo<>AssignedValueCard.Selected.Email, varAssignedTo, Parent.Default) 

     

    But "Previous Email" field always return Empty. 

     

  • jhall Profile Picture
    636 on at

    @azeesdinu wrote:

    in App OnSelect event I set the value to variable like 


    Sorry to be nitpicky, but do you mean App | On Start (meaning when the app begins) or are you firing this during an "OnSelect" event somewhere along the chain?

    The key is, the specific record in question must be loaded into the Form before you try to do this.  So doing it at App | OnStart would fail (be blank) or trying to do it tied to an OnSelect on any button/field before the Form is populated would as well.

  • azeesdinu Profile Picture
    80 on at

    Hi,

    I got it why it's empty now. I dont use the custom submit button on the form.I have used OOTB save button in the list. How can I capture the old value and compare it with updated value. 

  • jhall Profile Picture
    636 on at

    Let's try a screen shot or two.  Can you walk me through it w/ a couple of images?  That might help us both.

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

    Hi @azeesdinu ,

    Could you please share a bit more about your scenario?

    Do you create a custom form using PowerApps for your SP List?

    Further, do you want to capture the value within the "Previous Assigned To Email" column in your SP List when you edit an existing record using the custom form?

     

    Actually, when you add a Person within the "Assigned To" field first time, and click the "Save" button to submit your form data, you should also update the email value of selected Person in the "Assigned To" field into the "Previous Assigned To Email" column in your SP List.

    On your side, please set the OnSuccess property of the SharePointForm1 (Edit form) to following:

    Patch( /* <-- Add formula here. Use Patch function to update the email value of selected Person in the "Assigned To" field into the "Previous Assigned To Email" column */
     'YourSPList',
     SharePointForm1.LastSubmit,
     {
     'Previous Assigned To Email': SharePointForm1.LastSubmit.'Assigned To'.Email
     }
    );
    ResetForm(SharePointForm1);
    RequestHide()

     

    If you want to capture the value within the "Previous Assigned To Email" column in your SP List when you edit an existing record using the custom form, please take a try with the following formula:

    SharePointIntegration.Selected.'Previous Assigned To Email'

    If you want to compare the old "Previous Assigned To Email" column value with updated value Assigned To column value, please use the following formula:

    If(
     AssignedValueCard.Selected.Email <> SharePointIntegration.Selected.'Previous Assigned To Email',
    ...,
    ... )

     

    Please take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • azeesdinu Profile Picture
    80 on at

    Hi 

    Yes, I'm using "Customize Forms" options in the custom list PowerApps. 

     

     

     

     

     

    Previous User Email Feild DEfault.png
    SharePointIntegration Options.png
    OnSuccess - SharePointForm1 Screen.png
  • azeesdinu Profile Picture
    80 on at

    Hi v-xida-msft,

  • jhall Profile Picture
    636 on at

    You've got your Default setting for the PreAssignedToUserEmail field tied to an If() that is checking to see if it is different from the original email. 

    image.pngIf it differs, then you're changing the Default to be what's contained in this field to be the value of the AssignedToValue field (which I'm assuming is the new person).  So it appears you're blowing away your Previous email the moment you make any change to the AssignedToValue dropdown.  

     

    Also, if the PreAssignedToUserEmail field is linked to the same Form in SharePoint, then I don't believe there's a need for the Patch (it gets Submitted w/ everything else).  

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard