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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Automatically setting ...
Power Apps
Unanswered

Automatically setting a "Completed By" with UserID

(0) ShareShare
ReportReport
Posted on by 56

Hi All,

I think what I'm trying to do is fairly simple, but not 100% sure the correct way to go about it.

I have a basic app with an Edit Form that's tied to a SharePoint list which simply consists of "To-Do" items that can be assigned to other team members, categorized, etc. 

Within the Edit Form is a 'Status' dropdown (ddStatus) linked to a field of the same name in the SharePoint list. I have the "Items" property set to ["Open", "In Progress", "Completed"].

The list also contains a 'Completed By' field (txtCompletedBy) which is included as one of the Data Cards in the Edit Form. I'm looking to have that field auto-populated with the person's UserID if the 'Status' field (via the dropdown) is changed from "In Progress" to "Completed" (or from "Open" to "Completed"). As far as the UserID goes - that's already being stored in a global variable - varUserID - via the "OnStart" property of the App (using Office365Users connection). 

 

Thus, if John Doe selects an item from the gallery and then changes the 'Status' dropdown on the Edit Form to "Completed", the 'Completed By' field should then auto-populate with his UserID (jdoe). I'm assuming I just need to add some type of "IF" statement to the "OnChange" event of the 'Status' dropdown (ddStatus), i.e.: If(ddStatus.Selected.Value = "Completed", <something>)

But I'm not sure how to complete that to where it would populate the "Completed By" field with the UserID...

 

Any help would be greatly appreciated.

Thanks! : )

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at
    Re: Automatically setting a "Completed By" with UserID

    @bcanfield83 

    Change your Default property of the 'Completed By' control to:

    If(ddStatus.Selected.Value = "Completed", varUserID, Parent.Default)

     

    I hope this is helpful for you.

  • bcanfield83 Profile Picture
    56 on at
    Re: Automatically setting a "Completed By" with UserID

    Thanks! That worked perfectly 😊

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard