cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cyberco01
Post Prodigy
Post Prodigy

Capture the name of the person who changed the drop down value to submitted

Hi All,

I have a PowerApps Form linked to SharePoint.

In that I have a drop-down with status - Draft, Submitted, Closed.

I need to capture the name of the person who changed the value of the drop-down to Submitted only.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@cyberco01 

 

In the OnSave of SharePointIntegration,

 

CNT_0-1637650389861.png

 

do the following....

 

SubmitForm(SharePointForm1);
If(Combobox.Selected.Value="Submitted",
    Set(varPerson,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
       Claims:"i:0#.f|membership|" & User().Email,
       Department:"",
       DisplayName:User().FullName,
       Email:User().Email,
       JobTitle:"",
       Picture:""
    });
    Patch(yourSPList, SharePointForm1.LastSubmit,{personColumn:varPerson})
)

 

** remember to replace ComboboxSharePointForm1, yourSPList, personColumn as applicable.

View solution in original post

9 REPLIES 9
CNT
Super User
Super User

@cyberco01In the OnChange of the drop-down, check if Self. SelectefText="Submitted" and capture the currently User name there using, Office365Users.MyProfile().DisplayName

@CNT So do i need to create another person group field for that so that name is stored?

@cyberco01 if you want to store just the name, single line of text would do. But if you want to refer to that person itself, you need to create a person or group field. Depends on your requirement. 

@CNT, Kindly guide me where the above code can be written on the person group field to capture who changed the status to Submitted.

@cyberco01 Place this code in the OnChange of the drop down (replace yourSPList, the record to be patched & personColumn as per your need),

If(Self. SelectefText="Submitted",
    Set(varPerson,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
       Claims:"i:0#.f|membership|" & User().Email,
       Department:"",
       DisplayName:User().FullName,
       Email:User().Email,
       JobTitle:"",
       Picture:""
    });
    Patch(yourSPList, the record to be patched,{personColumn:varPerson})
)

 

cyberco01
Post Prodigy
Post Prodigy

@CNT Thanks for the response.

Please guide me on how I can get the record to be patched. The ID field on my list is the unique identifier for each record.

@cyberco01 I'll like to know 2 things,

1. Where are you capturing the information, is it in an EditForm?

2. When do you want to Patch the changes - as soon as the status changes? or when the user click a submit button?

It would be helpful if you could share some screen shots.

cyberco01
Post Prodigy
Post Prodigy

@CNT , Below is the screenshot of my form. The single form handles edit, new, and view.

The highlighted drop-down has values -  Draft, Submitted, Closed.

I need to capture the name of the person who changed the drop-down value to 'Submitted' in a Person-Group field.

The process will be - the user will change status to Submitted and click on SAVE on the form.

This value of the new Person Group need not change if any other changes to other fields are done to the form.

It just needs to capture the value when the status is changed to Submitted.

 

cyberco01_0-1637644265168.png

 

@cyberco01 

 

In the OnSave of SharePointIntegration,

 

CNT_0-1637650389861.png

 

do the following....

 

SubmitForm(SharePointForm1);
If(Combobox.Selected.Value="Submitted",
    Set(varPerson,{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
       Claims:"i:0#.f|membership|" & User().Email,
       Department:"",
       DisplayName:User().FullName,
       Email:User().Email,
       JobTitle:"",
       Picture:""
    });
    Patch(yourSPList, SharePointForm1.LastSubmit,{personColumn:varPerson})
)

 

** remember to replace ComboboxSharePointForm1, yourSPList, personColumn as applicable.

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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