cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Capturing the time stamp of the approval

Hello,

 

I have a PowerApps form where I would like to capture the time stamp of Approval by the manager.The approval field is a choice field with values "In Progress", "Ready for review" and "Manager approved".  I have two fields,  Date Approved and Approved by where I would like to capture the time stamp when the value of the Approval field is changed from "Ready for Review" to "Manager Approved" . Also capture the name of the person who changed the value from "Ready for Review" to "Manager Approved".

 

Please advise,

 

Thanks

7 REPLIES 7
Highlighted
Super User
Super User

Re: Capturing the time stamp of the approval

Hi @cooltechie. There are a few ways to do this. Assuming you have the following:

  • Approval_Type field with choices "In Progress", "Ready", "Manager Approved"
    • Set OnChange property to:
    • If(
      Approval_Type.Selected.Value = "Manager Approved",
      Set(varApproverName, User().Name); Set(varApprovedTime, Now())

  • Approved_By field
    • Set Default or Text property to varApproverName
  • Approval_Date field
    • Set Default or Text property to varApprovedTime

Good luck!

Highlighted
Helper IV
Helper IV

Re: Capturing the time stamp of the approval

Hello

 

Thank you for your response. I am getting an invalid argument error.

 

Regards,

Invalid Argument Type.jpg

Highlighted
Helper IV
Helper IV

Re: Capturing the time stamp of the approval

I tried the following:

 

If('Approval Status'.Value = "Manager Approved",
Set(varApproverName, User().Email);
Set(varApprovedTime, Now()), "")

 

I don't get access to Approval Status.Selected.Value property.  But I get Value property. However, with my formula, the approval time is recorded even if the value is "In Progress". How can I correct this?

 

 

Highlighted
Helper IV
Helper IV

Re: Capturing the time stamp of the approval

Also, in the same logic, I would like to capture the time when the Approval status is changed from In Progress to Ready for Review into a submitted time field. Please advise how to achieve this.

 

Thanks

Highlighted
Community Support
Community Support

Re: Capturing the time stamp of the approval

Hi @cooltechie,

Could you please share a screenshot more about your app's configuration?

Could you please share a bit more about the "Approved by" column? Is it a Person type column or Single line of text column?

Based on the formula that you provided, I think there is something wrong with it.

I agree with @seadude's thought almost, I assume that the "Approved by" column is a Single line of text column in your SP list, I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

 

8.JPG

Within above custom form, set the OnChange property of the Combo Box control within the ApprovalStatus Data card to following:

If(
    DataCardValue2.Selected.Value = "Ready for review" || DataCardValue2.Selected.Value = "Manager approved",
    Set(capturedTime, Now());Set(capturedUser, User().FullName)
)

Note: The DataCardValue2 represents the Combo Box control within the ApprovalStatus Data card.

Set the Default property of the Date Approved data card to following:

If(
    !IsBlank(capturedTime),
    capturedTime,
    ThisItem.'Date Approved'
)

Set the Default property of the Approved by data card to following:

If(
    !IsBlank(capturedUser),
    capturedUser,
    ThisItem.'Approved by'
)

Set the OnNew property of the SharePointIntegration control to following:

Set(capturedTime, Blank()); /* <- Add formula here */
Set(capturedUser, Blank()); /* <- Add formula here */
NewForm(SharePointForm1)

Set the OnEdit property of the SharePointIntegration control to following:

Set(capturedTime, Blank());
Set(capturedUser, Blank());
EditForm(SharePointForm1)

Set the OnView property of the SharePointIntegration control to following:

Set(capturedTime, Blank());
Set(capturedUser, Blank());
ViewForm(SharePointForm1)

The GIF screenshot as below:Test1.gif

Note: The Approval_Type @seadude mentioned in his formula is not the 'Approval Status' column in your SP list, it represents the Combo box control within the Approval Status Data card in your Edit form.

 

Best regards,

Kris

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.
Highlighted
Helper IV
Helper IV

Re: Capturing the time stamp of the approval

Hi Kris,

 

Thank you for the instructions. I will give it a try.  As far as Approved by field goes, I have it as Person Type field. However, It doesn't have to be a person field. I can change it to Single Line Text field. 

 

Also, when the Status is Changed to "Ready for Review", I would like to capture that in a seperate time stamp field known as "submitted time stamp". How can I modify your code to achieve the same? Can we add multiple if statements for the same control's Onchange event?

 

Please advise,

 

Thanks

Highlighted
Helper IV
Helper IV

Re: Capturing the time stamp of the approval

Hi Kris,

 

This worked for Approved time capture. However, I would like to capture another time i.e when a user changes the value from In Progress to "Ready for Review". I would like to set that as "submitted By" time.

 

Thanks.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,381)