cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.

 

 

 

4 REPLIES 4
Highlighted
Super User III
Super User III

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

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.

Highlighted
Frequent Visitor

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

@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...

Highlighted
Super User III
Super User III

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

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.

Highlighted
Frequent Visitor

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

@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..

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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