You can use custom expressions with in-database data. In fact, they are very useful. However, there are some limitations. The full suite of expression functions is not immediately available when working with external data, but there are some things you can do to mitigate this.
When Spotfire is showing external data in a visualization, the connector in use will translate Spotfire's internal data query into a query that the underlying data source understands. Connectors reveal their capabilities to Spotfire, so Spotfire understands those capabilities. The capabilities are also shown to you, the analyst, in the custom expression editor. Here's an example of the function help box in the expression editor when using external data in Microsoft SQL Server:
Notice how Spotfire suggests consulting the official SQL Server documentation...