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

Set Status date to Today when status changes to specific value - Integrated SP form

I am having an issue with trying to store the date when status of the ticket was changed to specific value (Integrated SP form):

What I did: I defined 2 variables - 1 to indicate if field has changed to specific value & one to track for which ID it happened and added below code to "on change" property of the "DatacardValueStatus

If(DataCardValueStatus.Selected.Value="Stored",UpdateContext({varStored:true,varStoredID:DataCardValueID.Text}))

 

Then to the Date field I added to "Default" property:

If(varStored=true And varStoredID=DataCardValueID.Text,Today(),Parent.Default)

 

The issue I am observing is that when I open any Item with status=Stored --> the variables get generated regardless if DatacardValueStatus was changed to Stored or not as defined in my if condition...

 

What should I do - is there any more elegant way to achieve what I am trying to do?

 

Thank you very much in advance for all the kind support.

 

 

 

5 REPLIES 5
eka24
Super User
Super User

The logic for DataCardValueID is not clear. What do you expect in DataCardValueID. If you expect example"AAA"

Then revise the formula to:

If(varStored=true And varStoredID="AAA",Today(),Parent.Default)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

aro1
Frequent Visitor

@eka24  DatacardValueID I only included because I often have a problem with clearing variables in Integrated Forms and I wanted to define another safety condition (specific ID) that would prevent the Date field to get updated on other records as well in case the variable did not get cleared properly... This way it can't happen that another records Date gets changed by accident... but the issue is that if I reopened my original record the next day the Date would be updated again which should not be the case....

- On change property triggers even if I just open the record...

If I understand you, you want to Check if a Date in your Table exist and also and ID exist. If they exist then set the DatePicker to Today

Is that the case

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

aro1
Frequent Visitor

@eka24  No Actually, the only thing I want to do is to set the Date Picker to today in case Status was changed to Distributed.

  •  variable for ID I only came up with as a safety to prevent other records to get modified as well in case variable is not cleared when SharePoint Integrated form is closed which often happens to me
  • My main issue is that "On Change" Property of the DataCardValue field seems to update my variable even when just the record with Distributed status is opened --> I expected it to happen only when the DataCardValue is actually changed..

Any luck with this?  I'm looking for a similar solution.  I have a PA connected to a SPO list. 

 

  • "Status" - SP choice field
  • "Resolved Date" - SP Date field

 

I need one or the other to occur:

 

  1. When the value of Status gets changed to 'Closed' --> assign 'Today' value to Resolved Date field
  2. When 'Resolved Date' gets assigned any value --> change the status field to 'Closed'

I'm wondering if this would be easier to configure in Flow...

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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
Users online (3,885)