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 III
Super User III

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

eka24
Super User III
Super User III

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Top Solution Authors
Top Kudoed Authors
Users online (86,649)