cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlafStetzer
Advocate I
Advocate I

Group by Owner/OwningTeam

Hi all,

 

I am struggling to use the group by operator in a list rows connect. How do I correctly adress the
field containing the owning userid or username. What is different when the owner is a team?

OlafStetzer_0-1614098835319.png

 

I have tried OwningUser OwningUSer/systemuserid and other variations as well in the group by operator and
always get error messages. In my case the owner is always a team.

 

 

 

4 REPLIES 4
ManishJain
Solution Sage
Solution Sage

Hi @OlafStetzer ,

 

For your scenario where owner is teams then use 

 

groupby((owningteam),aggregate(<fieldname> with aggregate(sum,max,min) as 'Alias Name'))

 

Thanks

Thanks for offering help. I got a step further but still get error messages. Sorry, I probably would know how to do that in SQL but the odata syntax is still a big mystery to me and I do not find good and easy to understand documentation on dataverse (which version of entity or column name or relationship table is need when etc....).

This is what I get so far: 

"$apply": "groupby((owningteam),aggregate($count as Count))"

leads to error message:

$apply/groupby grouping expression 'owningteam' must evaluate to a property access value.

And

"$apply": "groupby((owningteam/name),aggregate($count as Count))"

 leads to error message:

'Team' entity doesn't contain attribute with Name = 'ownerid' and NameMapping = 'Platform'.

 

Maybe I shall explain in more depth what I want to accomplish:
I have a dataverse table where I create several new entries with different owning teams (in that same flow).
At the end I want to generate one email per Owning team (to all Team members) with a list of the new entries I generated in that flow. 
I am struggling at point one where I want to create a list of distinct Team Names for the list of new entries.
This I want to use subsequently to filter the list of previously generated entries by Owning Team.
But maybe there is a much simpler way of getting the whole task done.

ManishJain
Solution Sage
Solution Sage

Hi @OlafStetzer ,

 

In aggregate transformation text box just use : 

 

groupby((owningteam),aggregate(<fieldname> with aggregate(sum,max,min) as 'Alias Name'))

field name is schema name .

i.e. groupby((owningteam),aggregate(prefix_name with Count as 'Alias Name'))

Thanks

RaashiSen
Community Support
Community Support

Hi @OlafStetzer ,
was using groupby function suggested by ManishJain was helpful?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,421)