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

Tracking changes in Date Picker

Hi everyone,

 

Currently developing an action tracking app, and in it we want the ability for users to change the due dates of actions that they are assigned. However, we do also want to track any changes that are made. For example, if an item was due 10/30/2019, and then the user changes it to 11/30/2019, we would want to be able to audit that.

 

Currently, my app is connected to a SharePoint list. Any guidance that can be provided would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @orbd ,

How does the user change the Due date for a specific action within your app? Via changeing the date value within the Date Picker control?

 

Just as @RandyHayes  mentioned, currently within PowerApps, there is no direct way to track the changes made to a specific item in a SP list data source.

 

As an alternative solution, you could consider take a try to create another SP list to store the changes made to the Due Date value of specific action items in your first SP list.

You could consider create another SP list as below:5.JPG

Note: The List Item ID is a Number column in above list, which used to store the Item ID value of the specific action item the user made changes to. The ChangedDueDate column is a Date type column, which used to store then changed Due Date value the end user made to the specific action item.

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

I assume that you added a Gallery control within your app to list all available action records assigned to you. Please set the OnSelect property of the "Submit" button to following:

If(
    BrowseGallery1.Selected.ChangedDueDate <> DataCardValue6.SelectedDate && EditForm1.Mode = FormMode.Edit,
    Patch(
         '20190325_case8',
         Defaults('20190325_case8'),
         {
             Title: "Track Action Item Changes",
             'List Item ID': BrowseGallery1.Selected.ID,
             ChangedDueDate: DataCardValue6.SelectedDate
         }
    );SubmitForm(EditForm1),
    SubmitForm(EditForm1)
)

Note: The DataCardValue6 represents the DatePicker control within the ChangedDueDate data card in my Edit form.

On your side, you should type following:

If(
    BrowseGallery1.Selected.DueDate <> DueDatePickerBox.SelectedDate && EditForm1.Mode = FormMode.Edit,
    Patch(                            /* <-- Store the changes the user made to the specific action items */
         'YourAnotherSPList',
         Defaults('YourAnotherSPList'),
         {
             Title: "Track Action Item Changes",
             'List Item ID': BrowseGallery1.Selected.ID,
             ChangedDueDate: DueDatePickerBox.SelectedDate
         }
    );SubmitForm(EditForm1),
    SubmitForm(EditForm1)
)

More details about the Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

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.

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@orbd 

There is no built-in audit or other tracking of datasources in PowerApps.  However, if this list is SharePoint based, then you can certainly turn on the version history on the list.  That way, any changes to records will be versioned and you will be able to see that information in the list itself.

If you need some other type of tracking, then you can always create a tracking or logging list and write records to it as the actions in your App happen.

 

I hope that provides some fuel for thought.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
v-xida-msft
Community Support
Community Support

Hi @orbd ,

How does the user change the Due date for a specific action within your app? Via changeing the date value within the Date Picker control?

 

Just as @RandyHayes  mentioned, currently within PowerApps, there is no direct way to track the changes made to a specific item in a SP list data source.

 

As an alternative solution, you could consider take a try to create another SP list to store the changes made to the Due Date value of specific action items in your first SP list.

You could consider create another SP list as below:5.JPG

Note: The List Item ID is a Number column in above list, which used to store the Item ID value of the specific action item the user made changes to. The ChangedDueDate column is a Date type column, which used to store then changed Due Date value the end user made to the specific action item.

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

I assume that you added a Gallery control within your app to list all available action records assigned to you. Please set the OnSelect property of the "Submit" button to following:

If(
    BrowseGallery1.Selected.ChangedDueDate <> DataCardValue6.SelectedDate && EditForm1.Mode = FormMode.Edit,
    Patch(
         '20190325_case8',
         Defaults('20190325_case8'),
         {
             Title: "Track Action Item Changes",
             'List Item ID': BrowseGallery1.Selected.ID,
             ChangedDueDate: DataCardValue6.SelectedDate
         }
    );SubmitForm(EditForm1),
    SubmitForm(EditForm1)
)

Note: The DataCardValue6 represents the DatePicker control within the ChangedDueDate data card in my Edit form.

On your side, you should type following:

If(
    BrowseGallery1.Selected.DueDate <> DueDatePickerBox.SelectedDate && EditForm1.Mode = FormMode.Edit,
    Patch(                            /* <-- Store the changes the user made to the specific action items */
         'YourAnotherSPList',
         Defaults('YourAnotherSPList'),
         {
             Title: "Track Action Item Changes",
             'List Item ID': BrowseGallery1.Selected.ID,
             ChangedDueDate: DueDatePickerBox.SelectedDate
         }
    );SubmitForm(EditForm1),
    SubmitForm(EditForm1)
)

More details about the Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

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
Top Kudoed Authors
Users online (1,488)