function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Adrielle Robinson 14Adrielle Robinson 14 

query for password policy changes

Hello, 

Not sure if this question posted correctly, so here it is again: 

I need to append this query to show any changes made to the password policies only. What do I add to retrieve only the changes to the password policies?

SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator' 

p.s. I am running this query in workbench, thanks! 
 
Best Answer chosen by Adrielle Robinson 14
Nayana KNayana K


SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator'  AND Action LIKE '%pass%'
 
SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator' AND Action = 'passwordexpiry'

My bad,  I missed 'AND'. 

All Answers

Nayana KNayana K
I am not sure whether this helps or not.

SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator'  WHERE Action LIKE '%pass%'

Above query returns records containing "pass" in Action field.

Try below to retrieve passwordexpiry:
SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator'  WHERE Action = 'passwordexpiry'
 
Adrielle Robinson 14Adrielle Robinson 14
Nayana, I recieve this error: MALFORMED_QUERY: 
CreatedBy.Profile.Name = 'System Administrator' WHERE Action = 'passwordexpiry'
^
ERROR at Row:3:Column:55
unexpected token: 'WHERE'
Nayana KNayana K


SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator'  AND Action LIKE '%pass%'
 
SELECT Action, CreatedBy.Profile.Name, CreatedDate, DelegateUser, Display, Id, Section 
FROM SetupAuditTrail 
WHERE CreatedBy.Profile.Name = 'System Administrator' AND Action = 'passwordexpiry'

My bad,  I missed 'AND'. 
This was selected as the best answer
Adrielle Robinson 14Adrielle Robinson 14
Thank you Nayana! I found the change I was searching for :)
Nayana KNayana K
Welcome :)