cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marcgiag
Resolver I
Resolver I

Auto Populating a text box with Office 365 display name who changed previous field & timestamp

I have a PowerApp, using a SharePoint list, where there are multiple tasks to be completed. As a specific task is completed (example Task1Completed switched from Off to On or On to Off) I want to populate Task1Owner with the Office 365 display name of who changed Task1Completed. Additionally I would like to record the DATE this change happened specifically for Task1Completed

 

2019-09-04_12-24-18.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @marcgiag ,

Do you want to auto-populate the values into the columns in your SP List when switch the Toggle control from Off to On?

Further, do you want to lock the Toggle control when the last person changed the Toggle control fro Off to On?

 

If you want to auto-populate the values into the columns in your SP List when switch the Toggle control from Off to On, I think the Patch function could achieve your needs.

I have made a test on  my side, please take a try with the following workaround:

Set the OnChange property of the Task1Complete Toggle control to following formula:

If(
Task1CompleteToggle.Value = true,
Patch( 'YourSPList', BrowseGallery1.Selected, { Task1Complete: true } )
)

Note: I assume that the Task1Complete is a Yes/No type column in your SP list to store the Toggle value. And you use a Gallery control in your app to list all avaiable records from your SP list.

 

Then please set the DisplayMode property fo the Task1Complete Toggle control to following:

If(
    ThisItem.Task1Complete = true,
    DisplayMode.Disabled,
    DisplayMode.Edit
)

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

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @marcgiag ,

Do you want to auto-populate the Task1Owner Text Input box and Changed Date Input box based on the Toggle control (switch Off to On)?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

I assume that when you switch the Toggle control from Off to On, the corresponding Task would be marked as Completed. Please set the Default property of the Task1Owner Text Input box to following:

If(
   Task1Toggle.Value = true,          /* <-  Task1Toggle represents the Task1Complete Toggle control in your app */
   User().FullName
)

or

If(
   Task1Toggle.Value = true,          /* <-  Task1Toggle represents the Task1Complete Toggle control in your app */
   Office365Users.MyProfile().DisplayName               /* <-- You need to add Office 365 Users connector as data source in your app firstly */
)

 

set the Default property of the Changed Date Text Input box to following:

If(
   Task1Toggle.Value = true,          /* <- Task1Toggle represents the Task1Complete Toggle control in your app */
   Now() 
)

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

 

Best egards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

@v-xida-msft ....  I have the 2 fields populating the data I wanted, but...

When I toggle to "True" it doesnt autofill the fields until I SUBMIT (not populated) and select Edit (populates), then it repopulates everytime the it is edited (could be a different date or person). I need it to LOCK in the last person who changed task Completed to True.

 

here is how we did it in infopath

 

 

2019-09-05_9-33-47.png2019-09-05_9-27-59.png

Hi @marcgiag ,

Do you want to auto-populate the values into the columns in your SP List when switch the Toggle control from Off to On?

Further, do you want to lock the Toggle control when the last person changed the Toggle control fro Off to On?

 

If you want to auto-populate the values into the columns in your SP List when switch the Toggle control from Off to On, I think the Patch function could achieve your needs.

I have made a test on  my side, please take a try with the following workaround:

Set the OnChange property of the Task1Complete Toggle control to following formula:

If(
Task1CompleteToggle.Value = true,
Patch( 'YourSPList', BrowseGallery1.Selected, { Task1Complete: true } )
)

Note: I assume that the Task1Complete is a Yes/No type column in your SP list to store the Toggle value. And you use a Gallery control in your app to list all avaiable records from your SP list.

 

Then please set the DisplayMode property fo the Task1Complete Toggle control to following:

If(
    ThisItem.Task1Complete = true,
    DisplayMode.Disabled,
    DisplayMode.Edit
)

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

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,095)