cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cooltechie
Level: Powered On

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
seadude
Level 10

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!

cooltechie
Level: Powered On

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

cooltechie
Level: Powered On

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?

 

 

cooltechie
Level: Powered On

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

Community Support Team
Community Support Team

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.
cooltechie
Level: Powered On

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

cooltechie
Level: Powered On

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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 204 members 4,534 guests
Please welcome our newest community members: