hello everyone Raza here in this video Iwill show how we can query the graph APIusing standard connectors directly frompowerappsthe graph API is the one endpoint thatwe can query to get our Enterprise datacalling the graph API directly frompowerapps opens up a world ofpossibilitiesthe best part is that powerapps nowunderstands the response that the graph

API sends backso let's check this out in action[Music]the Microsoft graph API is a singleendpoint that we can leverage to accessand interact with Microsoft 365 servicesand datathe graph Explorer is a great tool thatwe can leverage to access the various

endpoints that are provided for usfor exampleget my profileif I click run querythis will provide a Json response withmy profile detailsnote I have signed in to myorganization's account in the graphExplorerand hence I see all my details basedupon my accountin powerapps to make a call to the graph

APIyou can go to data sourcessearch for Office 365 groupsand connect to itI will insert a button controlso on click of this buttonI will go ahead and make a call to thisgraph API endpoint to get my profiledetailsthis is a get requestand it does not have any request body

so I will copy thisand in my PowerApp on select of thisbuttonI will use Office 365 groups DotHTTP requesthere we can call the graph API endpointso I'll putthe graph API endpoint that I would liketo callnext property is the method in this caseis a get request

and the third property is a data typefile that's the request bodyin this case it is empty so I'll simplypass an empty stringthe response that I getI will store itin a variableand now if I go ahead and click on thisbuttonit will go ahead and call that graph APIendpointand the response will be stored in the

variablenow previouslythis response that we would receive inpowerapps would always be a Boolean datatypepowerapps did not understand theresponse that was receivedbut now this data type has changed tountyped objectone of my MVP friends Hiro noticed aboutthis recent change

and he has a blog post which highlightsthe fact that we can get informationback from graph API in a format calleduntyped objectand the key update that provides thisresponse typeis under settingsupcoming features previewparse Json function and untyped objectsthat needs to be turned onnow the response that I get is in Json

formatpower apps though understands it in theformat of an untyped object which wehave to Traverse through in order to getthe detailsnow to confirm that this untyped objectactually holds the Json response fromthe graph APIunder Advanced tools we have a toolcalled monitorI'll go ahead and open monitor

and this will now get connected to mystudio sessionI will click this buttonwhich will once again go ahead and makethat graph API callnow if I go to monitorthere is a network request HTTP requestwhich is using the Office 365 groupsendpointif I select thisI have the detailsI have the requestand has the response

the response body is that Json responsethat has my profile informationand that's that untyped objectnow if I need the display name from theresponsehere in my power appI will add a label to show the displaynamethe text property for thisI will use my variable which is where myprofile which is an untyped object Dot

display nameand that goes ahead and grabs the valuelet's pick job titlethis will be where my profile dot jobtitleso as you can see I can easily get thedata from that untyped objectget my profile details is something that

is already available in powerappswe have a connector called Office 365users that can give me my profiledetailsso I would recommend to First explore ifthere is a connector that alreadyexposes those details for usif no then we can take advantage of thegraph APIlet's just say I call an endpoint calledtest

if I run thisif I look at where my profilenotice it gives me an error messageand it says that only specific endpointsare supported like me which gives youall your details your profile your filesyou can get information related to usersOffice 365 groupssites SharePoint OneDrive the searchendpoint planner teams chat

so there are quite a few usefulendpoints that we can take advantage ofin graph Explorerhere we have Microsoft teamsand one of the actions is my joinedteamsif I run thisit will provide a response which has aproperty called value it's an arrayand it has details about the teams thatI have joinedso let's call this endpoint frompowerapps

I'll store this response in a variablecalled where my teamsmonitorI have monitor runningI'll click the buttonit will call the graph API endpointhere's the successlet's go straight to the response andyou can see the response body hastabular data which has all the detailsabout the teams that I have joined

I can even change this to Json tree tolook at the Json response that I havereceivedthe untyped object begins from the bodyattributenow in this there is a property calledvalue that's an arraythat holds the information about all theteams that I am a part ofnow since it's an arrayI will leverage a gallery to list outall the teams

for the items property of the galleryI will use the variable where my teamsdot valuenow value is an arrayso it's still an untyped objectbut I know it has tabular data so I willTypecast this to atablethe value which are these objects which

has the team details is also Json dataand from there I want the display nameof the teamin my galleryI have this title labelso I will use this item Dotvalue Dotmy property which is display nameand we can see how it's listing out allthe team names that I am a part ofif I need any other property like the

descriptionhere I have another label calledsubtitle so I'll use this item dot valuedot descriptionand here is a list of all the teams thatI am a member ofif you want a list of all the endpointsthat are available as part of graph APIsimply select Microsoft graph APIreference documents and this will lead

us to the documentation that hasinformation about all the differentendpoints that we can callremember we are limited to those certainendpoints from The Office 365 groupsactionwe have an option here sites and listsand if I go to sitethere is one endpoint called get listsand this will list out all the lists andlibraries that are a part of yourSharePoint siteit's a get request

all it requires is the site IDin graph Explorerif we go to SharePoint sitessearch for a SharePoint site by keywordit calls an endpoint and also passes akeyword to search onif I run thisit will search for sites based on thesearch parameter that I providedso I can use this endpoint in powerappsand dynamically read the searchparameter from the user

I'll copy this endpointgo back to powerappsI have a text input control and I have abutton to search siteswhen this button is clickedI will call that endpointthe search text is hard codedI will change thisampersandmy text input controldot textmy variable I'll call it where sites

the response is once again an arrayI would like to show the name of thesiteso let's make a testI'll search for contosoclick search sitesthis will have my variable loaded withthat untyped objectI'll add a gallery because I get anarray response from this graph endpointso for the items probably

I'll use that variable where sites Dotvalueso I will type cost this to a tablefor the title label controlso this itemdot value dot nameand I will also show the descriptionso this item dot value dot descriptionso these are the SharePoint sites thatit's searching for in my tenant

I have an icon control hereI will change this to linkand when this is selectedI'll use launchwhat's the addresshere I have a property called Web URLthat gives me the URL of the SharePointsitethis itemdot value dot web URLdo not want to pass any parametersand launch this in a new tab

let's previewI select thistakes me to the SharePoint siteand this is completely dynamic let'ssearch for 365.I have a couple of SharePoint siteswhere the title or description contains365.and this will take me to thoseSharePoint sitesnow notice in here I also get the ID ofthe SharePoint sitewe also have another endpoint that gives

us the details of all the lists in aSharePoint site so I'll copy thispaste it in graph API Explorerjust the end pointsite ID tokenthis I will replace it with the ID ofthis SharePoint siteand if I run the queryit will give me all the lists andlibraries that are a part of thatSharePoint site

here I have the list of SharePoint sitesnow when any item in this Gallery isselected so the gallery has an on SelectPropertyhere I will set another variableI'll call it where listsI will call Office 365 groups dot HTTPrequestmy endpointI'll put my endpointthis is a get requestand I'll close my function

for site IDhereI'll make this dynamicI will use this item dot value Dotthe property is called IDdot IDso this will give me all the listsso if I selectyou'll see where lists is an untypedobjectlet's add another gallery nowto show the list details

and for this Gallery the items will belists dot valuetype Caster to a tableto know the response of that untypedobject you can check in graph Exploreror look at the documentation that givesyou detailsor you can also leverage monitorso notice value is arrayin thereI want the name

so this itemdot value dot nameand then for the subtitle labelI would like to show whether it's a listor a library so we have a propertycalled template that gives thatinformationnow notice in the main object there is aproperty called listin that there is a property calledtemplate traversing through Json

so this item dot value dot listdot template these are case sensitivelet's preview the appso for my Rd Tech SharePoint site theseare the lists and librarieslet's change the searchfor contoso these are my lessonlibrariesfor power HR these are the lessonlibrariesand now to tie it up in a real world use

caseI have a power app that showcasesdetails from a SharePoint list calledtaskson the left hand side it lists out allthe tasks names and who the task isassigned tofor the selected task I have a formwhere I can update the properties of thetaskand then on the right hand side I'mactually showcasing the version historyof the items of that SharePoint sitedirectly in powerapps without calling

any flow I am simply using graph APIso when I select a specific item I cansee all its versionsthe progress of this item is behind butpreviously it was in progressthat is version 11.here's version 10. here's version 9.let's make a change to this itemI'll editI'll change the status of this task tocomplete itand submit

the moment I do that it pops in anotherversionso the previous version of the item hadthe progress as behind but now theprogress is completedand how is this possiblewhen I select a specific item in thisgalleryI am leveraging the graph API endpointto get the versions of an itemhere's my graph API endpointmy site ID my list IDitems slash the ID of the item which I

already have in this gallery that isconnected to that listslash versionsand from versionsgo and get me three columns from my listtitle progress and prioritymy gallery for versionsis that variable.value type constant toa tableand then right here at the bottomI'm showing the details based upon the

selected item of the gallerygallery.selected dot value the Json thatgets returnedas a property Fields within it I have mycolumn values so I'm just simplytraversing through the Json to showthose valueslet's take another examplefor a specific task I can assign thetask to usersnow this assigned to is a person typecolumn in my SharePoint list however

here it only allows you to select twousersso it's actually loading users in thatcombo box option based upon users whoare owners of an Office 365 groupon the onstart of this PowerAppI am making a call to a graph APIendpointgroups slash the ID of the groupslash ownerslet's run monitor for this power app

and let's run app onstartso here's the HTTP requesthere is the responsethis group has two ownersif I go to Json treeI can see the response valueand I wanted to load all thatinformation in a collectionso I looped throughall the items in the value property ofthe Json response which is the array and

from there I grabbed the display name ofthe user and the user principal nameand I've placed that in a collectionso if we explore the collectionthese are the two users who are theowners of this Office 365 groupand this is a group called cat teamall I needed is the IDit has two ownerslet's add a third owner James

back to my PowerAppif I run thisnotice James also gets added to thatcollectionand that collection is what I'm bindingto this combo boxso now I can assign this task to any ofthose owners and no other userslet's assign it to Jamesthe task is assigned to James a newversion gets createdand you are not just limited to get

requestshere is a scenario where I would like toupload a document to a SharePointLibraryeven inside foldersthere is no action in powerapps that candirectly do that we typically have toleverage power automate to do thatI'll click uploadupload a fileand when I click uploadthis is where I will post all the filesin this attachments control

to my SharePoint Libraryonce again I'm leveraging graph APII have done a video on this so I'll linkit in the description for this videothis time it's a put request since I'mputting a filethis requires a data type file in thiscase these attachments are files so it'seasy for me to post thisby simply pointing to itso if I click upload

this will upload this file to SharePointand here is the latest fileand I can also do this within folderslet's try and upload a filedirectly to a folderand there is my fileone scenario that comes to top of mymindI have a SharePoint listthat has thousands of items

the number one challenge in powerapps issearching we run into delegation issuesI'll search for taxthis is now performing a search queryagainst that entire SharePoint listI have items with same names so I'veactually printed the item IDs as well toprove that these are separate itemslet's search for videosand those are my resultsthis call to get the data is not easy

the reason is because the post requestin powerapps requires to pass a filenow how do I pass a file property wherein this scenario I'm actually justputting data in a text boxI'll show you that in a future videoif you enjoyed this video then do likecomment and subscribe to my YouTubechannel and thank you so much forwatching