cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OlaH
Helper III
Helper III

Check for existing Teams name, Microsoft Graph?

At our school we have a form in Power Apps where teachers order Teams for there classes. Before the order is sent we'd like to check if the Teams name already exists.

Could this be done with Microsoft Graph?

If so, how?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @OlaH :

First create a custom connector:

2.PNG

I think this link will help you a lot:
https://www.youtube.com/watch?v=ORHghzhvmyA

Secondly,Create a button and set it's Onselect property to:

If(
    !IsBlank(MSGraphAppConnector.GetGroups({'$filter': "displayName eq 'TheGroupName'"}).value),
    Notify("The group already exists"),
    CreateYourGroup /*Create Group, use your own formula*/
)

555.gif

/*'A Talk' is a group that already exists*/

Best Regards,

Bof

View solution in original post

6 REPLIES 6
v-bofeng-msft
Community Support
Community Support

Hi @OlaH :

You could try:

Get https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'YourGroupName'

If the value of Value in the return value is empty, then the group named "YourGroupName" does not exist

1.PNG

Best Regards,

Bof

Thank you @bo for your suggestion but I can see that I wasn't clear in my question.

I want to see in the app, before the order is send, it the Teams exist.

Hi @OlaH :

You can use this API to get the return value first to determine whether there is a corresponding group.

Get https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'YourGroupName'

 If the value of Value is empty, execute the command to create the group.

Best Regards,

Bof

Ok, but forget me. I've not worked with this kind of API before.

 

Could you please explain how I would use this to show a warning icon (Visible) if the team exists? 

Hi @OlaH :

First create a custom connector:

2.PNG

I think this link will help you a lot:
https://www.youtube.com/watch?v=ORHghzhvmyA

Secondly,Create a button and set it's Onselect property to:

If(
    !IsBlank(MSGraphAppConnector.GetGroups({'$filter': "displayName eq 'TheGroupName'"}).value),
    Notify("The group already exists"),
    CreateYourGroup /*Create Group, use your own formula*/
)

555.gif

/*'A Talk' is a group that already exists*/

Best Regards,

Bof

View solution in original post

This forum is absolutely wonderful, thanks @v-bofeng-msft.
Thank you for spreading your knowledge and helping us who are in need of it.

 

Now I get in to it right away.

 

/Ola

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,262)