monitoring salesforce using a SOQL query with power automate
this shows how to use the ‘execute a soql query’ action in power automate to simply monitor for exceptions or issues in salesforce. this action gives you much more flexibility than the get records salesforce connector, which can only hit a single object.
overview

components
recurrence: standard - set the frequency etc
execute soql query: write pure soql - not the odata format that is used in the get salesforce records power automate connector. LAST_N_DAYS works - which can be helpful for monitoring purposes
compose: to count the number of records returned. you have to manually add [‘Records’] after inserting the dynamic content
length(body('Execute_a_SOQL_query')['Records'])

condition: evaluate the number of records returned and decide which path to follow
create html table: convert the output to html for inserting into an email. same content as the compose above, just...
