Skip to content

Instantly share code, notes, and snippets.

@agentgill
Created January 8, 2022 16:20
Show Gist options
  • Select an option

  • Save agentgill/6d4da0d8a88ac1c6f3c7242dfa8e42ff to your computer and use it in GitHub Desktop.

Select an option

Save agentgill/6d4da0d8a88ac1c6f3c7242dfa8e42ff to your computer and use it in GitHub Desktop.
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