Gorav Seth

Salesforce MVP (HOF) | Permaculture designer

Read this first

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
Screenshot 2026-08-07 200946.png

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'])

Screenshot 2026-08-07 201318.png

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...

Continue reading →


deleting inactive flow versions using agentforce vibes

using this approach from sfse, in agentforce vibes

  1. log in to vibes
  2. create a new text file directly in the root folder. in my example i named it rmflow.sh
  3. enter the script into the file. i havent figured out how to get $USERNAME to work in vibes, so i just hard code my username
sfdx force:data:soql:query --query "SELECT Id FROM Flow WHERE Status != 'Active' AND  Definition.NamespacePrefix = '' " --target-org gsethXXX@XXX.org.dev --use-tooling-api --result-format csv > flowTodelete.csv

while read c; do
    if [[ "$c" != "Id" && "$c" != "Your query returned no results." ]]
        then
            sfdx force:data:record:delete --sobject Flow --record-id $c --target-org gsethXXX@XXX.org.dev --use-tooling-api
    fi
done < flowTodelete.csv

rm flowTodelete.csv
  1. in terminal, type chmod +x rmflow.sh (this makes the file executable)
  2. type ./rmflow.sh (this runs the script)

it will...

Continue reading →


Using Power Query for data reconciliation across two sources with a common ID

There are many ways to reconcile data, especiially for those with a sql db at their disposal. We had data in two systems that was supposed to be the same but had some discrepancies so I took a stab at sorting through it using power query and landed on a remarkably straightforward approach.

In my case one source was XML and the other salesforce. Power query has some odd behaviors with how it handles some data types in xml files, but i will leave those out and hope XML will disappear and make the world a better and safer place.

This exercise assumes you have two queries in a single power query file - one for each data set, and the column headers are the same in both files. If needed, there are ways to use a mapping file to transform the column names, which others have written about.

There were two key features that make this work

1: Unpivot other columsn

in each query, right click...

Continue reading →


evaluating field usage in excel / power query / power bi

RIP Field Trip…a great app it was. there are other apps now that do the same thing, and free ones to boot. I’m sure they are great but my new job has some hoops to jump through to install them so i tested out the idea i had years ago to do this using power bee eye.

The M language used in power query makes it remarkably easy to do this. It has a Table.Profile function, which takes a table as an input, and returns the usage, like magic.

You can use the salesforce integration to pull an object, and add one line of code in advanced editor, and you have it.

If you want to filter by record type, or any other field on the object, you can do that via the power query UI prior to adding the line of code to run the profile. It also is possible to do this dynamically by record type, but is more complex, so that will be a separate article.

Note that if you run this on your desktop and have an...

Continue reading →


SSO from prod to sandbox using ECA

This is the Winter26 Update for this article/how i solved this session re sandbox SSO magic: https://goravseth.com/single-sign-on-from-production-to-sandbox

Connected Apps were voted off the island, and now we have external client apps, which are great. It is possible to do the same SSO magic with an ECA, but there is currently a bug (that for some reason they will not create a KI for) that requires a funny workaround

The bug: If you set the start URL -> custom in the ECA, the app ignores whatever permissions you apply for who can access the app, and it shows up in the app menu for everyone. Those without access are currently redirected to classic and shown an ugly error…

Support acknowledged this is a bug and said its actively being worked on 2 months ago, so keep holding your breath…

The workaround: click enable oauth, set start URL to oauth, and enter the URL there. The rest...

Continue reading →


display all open opportunities for all accounts in hierarchy

A related list can highlight open opportunities on the account , for those people who find it too much work to look themselves to make it easy to see them. Recently a power user raised the need for finding open opportunities for other accounts within the hierarchy. So we built a screen flow to do this

It was fairly straightforward, thanks to the relatively recent addition of the IN operator for get elements.

It does require a get element in a loop, which is generally bad form but should be fine in this use case, as we are in a screen flow and you would need a 99 level deep hierarchy to hit the 100 query limit.

There are probably other ways to solve this, but the key for me was to realize I must first navigate to the top of the hierarchy (via the get in the “loop”) and then work my way down, level by level, adding all the child account IDs to a collection variable. A final query...

Continue reading →


displaying files in flow datatable with clickable link

solved an interesting question on ohana slack asking about how to display the files attached to a related record in a “legacy” approval process page.

you can do this using a flow datatable, but there are some tricks required for making a clickable link to the file.

salesforce files have 3 objects, and they dont always play nicely

a) content document : this is the file preview page when you are looking at a file. IDs start with 069

b) content version : these are the file versions, and IDs start with 068

c) content document link these allow the many to many relationship to connect one content document to multiple records. i dont know what the Ids start with …

here is the full flow.

Screenshot from 2025-05-02 12-20-28.png

here are the details on how to build it

to start, you must create an input text variable in your flow named recordId. this will be populated automatically when you add the flow to a record page.

...

Continue reading →


deploying case status values from sandbox

after a long long time created a new support process in sandbox, and of course you cant deploy standard picklists with change sets.

if i had used devops center i would prob be sorted, but I would have to redo everything. i found it to be too much overhead to deal with for what we needed, and havent played with it recently.

so instead, i did the following

1) include the support process in the change set

  • make sure your change set includes the record type associated with the support process.
  • then click ‘view / add dependencies’ and you can select the support process to include it. thats the only way to get it

2) retrieve case status via metadataapi / workbench

create a file named package.xml and include this and only this

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>CaseStatus</members>
...

Continue reading →


salesforce integration user

stumbling in the dark…found a path

option 1 - this works

  • create integration user – user license = salesforce integration – profile = minimum access - api only integration
  • assign permission set license from user page (permission set license assignments -> edit assignments - salesforce api integration)
  • create permission set (no license type)
  • set object access and field access in perm set
  • assign perm set to user

option 2 - this is supposed to work, but would not for me

  • create integration user – user license = salesforce integration – profile = minimum access - api only integration
  • create permission set with license type = salesforce integration
  • assign permission set to user
  • create permission set (no license type)
  • set object access and field access in perm set
  • assign perm set to user (error)

i am unable to assign a perm set that grants access to standard objects to the users, even...

Continue reading →


flow http callout and transform element

in preparation for a user group session with peter churchill re extending flow with http callouts and lwc for a dc user group meeting, i tested http callout and external services against the petfinder api, developer.trade.gov consolidated screening list api, and the boldsign api. my notes and observations re http callout and transform element are below. peter figured out a bunch of cool things

One of the first decisions to make is whether to use http callout or use external service. My conclusion is that if the endpoint provides an open api spec, it is easier to create an external service and select the methods you need in the flow, for the following reasons:

  • when you create a http callout action, you paste in the response and then salesforce parses it. in this process, you have to go through and manually set the types (string, date, boolean, etc) for any properties that the...

Continue reading →