Skip to content

Instantly share code, notes, and snippets.

@AshV
Created June 6, 2023 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshV/7fb6dfe0b6ffa809d2270b63b20526e2 to your computer and use it in GitHub Desktop.
Save AshV/7fb6dfe0b6ffa809d2270b63b20526e2 to your computer and use it in GitHub Desktop.
FetchXml query to list all Owner Teams where Current/LoggedIn user is a member.
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
<entity name="team">
<attribute name="name" />
<attribute name="teamid" />
<filter type="and">
<condition attribute="teamtype" operator="ne" value="1" />
</filter>
<link-entity name="teammembership" from="teamid" to="teamid" visible="false" intersect="true">
<link-entity name="systemuser" from="systemuserid" to="systemuserid" alias="ae">
<filter type="and">
<condition attribute="systemuserid" operator="eq-userid"/>
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment