Created
January 8, 2022 16:20
-
-
Save agentgill/6d4da0d8a88ac1c6f3c7242dfa8e42ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sfdx force:data:soql:query --query "SELECT Id FROM Flow WHERE Status = 'Obsolete'" --targetusername $USERNAME --usetoolingapi --resultformat csv > flowTodelete.csv | |
| while read c; do | |
| if [[ "$c" != "Id" && "$c" != "Your query returned no results." ]] | |
| then | |
| sfdx force:data:record:delete --sobjecttype Flow --sobjectid $c --targetusername $USERNAME --usetoolingapi | |
| fi | |
| done < flowTodelete.csv | |
| rm flowTodelete.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment