Afternoon all, I'm trying to find a way to notify a user of what changes were made to an edit form within my app.
I have created two collections, one when the edit form page is visible
And another which is on the onchange property of my dropdown boxes.
This works well in as much as it shows the modified data in the second collection.
I need to be able to compare the two though, filter to only show those that have been modified / do not match.
End goal is to then send a html table of the changes to a user - just not sure on how to compare the two, many thanks.
Solved! Go to Solution.
Sorry I was away for a while, try this.
ForAll(Addcolumns(OriginalRecordUserPermissions, "oldField",FieldName)
ForAll(NewRecordUserPermissions,
If(FieldName = oldField && OldValue <> newValue, Collect(colChanges, {
FieldName: FieldName,
FieldValue: newValue
}))))
Once again sorry for the trouble and delay 😞
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Hi @PPSA ,
I see you are creating the collections with multiple columns create the collections with Row orientation as below:
Clear(OriginalRecordUserPermissions)
Collect(OriginalRecordUserPermissions,{FiledName:"PO1",OldValue:DataCardValue43.SelectedText.Value})
Collect(OriginalRecordUserPermissions,{FiledName:"PO2",OldValue:DataCardValue45.SelectedText.Value}) and so on....
Do the same to changed values collection also.
And then try this to find the changes:
ForAll(OriginalRecordUserPermissions,ForAll(NewRecordUserPermissions,If(OldValue=newValue,Collect(colChanges,{FieldName:FieldName,FieldValue:newValue}))))
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Thanks for your response @KrishnaV ,
I've restructed both collections now as below.
I added a button with your for all expression in to test and it isn't producing expected results, no doubt I may have misunderstood something?
I only changed the one record from 0 to 1.
Thanks
@KrishnaV i have changed the for all expression slightly to be <> instead of = as I want to create the record for what has changed.
Now when I test this I get the modified record but 20 lines for each change, can we change this to just one line per change?
Thanks
Small work around was to filter the gallery with FirstN(colChanges,Sum(CountRows(colChanges)/20))
Working for what I need although there's probably a fix somewhere.
Sorry I was away for a while, try this.
ForAll(Addcolumns(OriginalRecordUserPermissions, "oldField",FieldName)
ForAll(NewRecordUserPermissions,
If(FieldName = oldField && OldValue <> newValue, Collect(colChanges, {
FieldName: FieldName,
FieldValue: newValue
}))))
Once again sorry for the trouble and delay 😞
I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.
Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.
Thanks @KrishnaV , I have this working now, just need to place the collection into a html table to be emailed out now.
I see your fairly active on here and know your stuff, could you have a little look at this thread i posted a few days back?
Only comment on there so far is somebody else is experiencing a similar issue.
Thanks for your time
https://powerusers.microsoft.com/t5/Building-Power-Apps/Losing-data-when-close-and-open-again/m-p/64...
User | Count |
---|---|
253 | |
122 | |
106 | |
54 | |
48 |