cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jon2787
Advocate I
Advocate I

PowerApps Audit Trail

I’m trying to create an Audit Trail within PowerApps, does anyone know how I can possibly do this?

 

For example, on the click of a button (Button1) I would like to copy the data from (Datacard 1 and Datacard 2 and place this on Datacard 3)

 

I would like to keep track of this data so each time the button is pressed it will create a new row in Datacard 3 so I can have an Audit of the data and any changes.

 

Any help would be great.

Thanks

13 REPLIES 13
poweractivate
Super User
Super User

@Jon2787 
To make a true copy or clone of a piece of data, try Patching the data using the Patch function.

Patch( DataSource, Defaults( DataSource ), { FieldToChangeOrAdd: "NewValue" } )

 See if it helps.

Thanks, I’m not trying to clone data I’m essentially just trying concatenate the data from Datacard1 and Datacard 2 and show this combined in Datacard 3. However each time the button is pressed it will copy the latest field values and not overwrite what’s already showing in Datacard 3. Almost acting like an audit trail for users to see on the form. Thanks 

@Jon2787 

 

Default property of DataCard3

//pseudocode - modify below as appropriate
DataCardValue1.Text & DataCardValue2.Text

Check if it helps @Jon2787 

Thanks unfortunately I don’t think that will work as this will only show current values, and not keep an ‘audit trail’ of previous values 

@Jon2787 

 

OnSelect of Button

Set(myVar,DataCardValue1.Text & DataCardValue2.Text & Char(13))

 

DataCard3 Default

myVar

 

See if something like this works for you.

 

This is really close to what I’m looking for however the data gets overwritten each time the field values change so it doesn’t keep any form of audit trail of the previous values 

OnVisible of Screen1

ClearCollect(myColl)

 

OnSelect of Button

Collect(myColl,DataCardValue1.Text & DataCardValue2.Text)

 

DataCard3 Default

Concat(myColl,ThisRecord.Value,Char(13))

 

See if something like this works for you.

Unfortunately doesn’t seem to work and recognise ‘myColl’

@Jon2787 

 

1. Double check you did this

OnVisible of Screen1

ClearCollect(myColl)

and make sure the two other formulas are there

OnSelect of Button

Collect(myColl,DataCardValue1.Text & DataCardValue2.Text)

 

DataCard3 Default

Concat(myColl,ThisRecord.Value,Char(13))

 

 

 

2. Even if you did do it, create a Blank Screen now.

3. Toggle back and forth from the blank screen to the first screen (or whichever screen you put the formula for OnVisible on)

 

See if it works now @Jon2787 

 

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (3,844)