Search code examples
dotnetnuke2sxc

How to get PortalId into sql script for 2sxc visual query


I need to run a sql script in a 2sxc visual query.

I can do "where portalid = 709"

But, to use this in any portal, how do I automatically the the PortalId into the script?


Solution

  • Use the token [Portal:PortalId] in your sql ;)

    For other token examples, like [QueryString:xyz] see https://docs.2sxc.org/api/dot-net/ToSic.Eav.DataSources.Sql.html