cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bcanfield83
Frequent Visitor

Automatically setting a "Completed By" with UserID

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! : )

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks! That worked perfectly 😊

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,594)