Data Providers
...
MS Graph
Graph Mail
Get list messages
5min
scenario get a list of emails for a user in microsoft graph using a get rest function and displaying the emails in a list {{jig}} press on an email to view the content of the email resource links list messages ms graph documentation graph explorer configuring oauth for ms graph docid\ lrk 3uhlyqp 6pgsbx4gq required oauth scope (least to most privilege) mail readbasic mail readwrite mail read list messages examples and code snippets examples and code snippets when using the code and samples in this topic, remember that they are designed to function as part of a comprehensive solution to fully benefit from the intended functionality and ensure compatibility, it is recommended that you use the entire solution rather than selecting individual components in isolation alternatively, you can use these samples as a guide to understand the underlying concepts and ms graph api, which can help you integrate similar solutions into your projects more effectively the entire ms graph solution is available on github general index jigx name ms graph demonstrator title ms graph demonstrator description a sample solution that uses the microsoft graph api you can deploy and use this solution without any additional configuration category business tabs home jigid view user jigx icon home apps logo calendar "2x2" jigid calendar summary icon calendar meeting jigid next meeting when | \=@ctx datasources next meeting=null? false\ true icon meeting remote emails jigid list email messages icon email functions ms graph list messages function in github get email messages jigx provider data provider rest method get url https //graph microsoft com/v1 0/me/mailfolders/inbox/messages outputtransform $ uselocalcall true parameters accesstoken location header required true type string value microsoft oauth #use manage jigx com to define credentials for your solution $filter type string location query required false $top type string location query required false value 200 records =$ value continuation when =$ "@odata nextlink" url =$ "@odata nextlink" parameters accesstoken location header required true type string value microsoft oauth jigs ms graph messages {{jig}} in github list email messages jigx title ="inbox " & $count(@ctx datasources mydata) & " items" type jig list icon contact header type component jig header options height small children type component image options source uri https //blog smu edu/itconnect/files/2020/12/featured image email 354ca1 1 png onrefresh type action action list options actions \ type action sync entities options provider data provider rest entities \ entity email messages function get email messages functionparameters accesstoken microsoft oauth $filter ="receiveddatetime ge " & $frommillis($millis() 432000000) $top "200" datasources mydata type datasource sqlite options provider data provider local entities \ entity email messages jsonproperties \ body \ sender \ from \ torecipients \ replyto query select id, '$ receiveddatetime', '$ sentdatetime', '$ hasattachments', '$ subject', '$ bodypreview', '$ importance', '$ conversationid', '$ isread', '$ inferenceclassification', '$ body', '$ sender', '$ from', '$ torecipients', '$ ccrecipients', '$ bccrecipients', '$ replyto' from \[email messages] where '$ inferenceclassification' like @filter and json extract(data, '$ sender emailaddress address') != @me order by '$ receiveddatetime' desc queryparameters filter =@ctx jig state filter me =@ctx user email data =@ctx datasources mydata item type component list item options title =@ctx current item sender emailaddress name divider solid subtitle =@ctx current item subject description =@ctx current item bodypreview rightelement element icon icon =(@ctx current item hasattachments = 1 ? 'document' '') leftelement element avatar text =$substring(@ctx current item from emailaddress name, 0, 1) uri '' onpress type action go to options linkto view email parameters receiveddatetime =@ctx current item receiveddatetime sentdatetime =@ctx current item sentdatetime hasattachments =@ctx current item hasattachments subject =@ctx current item subject bodypreview =@ctx current item bodypreview importance =@ctx current item importance conversationid =@ctx current item conversationid isread =@ctx current item isread inferenceclassification =@ctx current item inferenceclassification body =@ctx current item body sender =@ctx current item sender from =@ctx current item from torecipients =@ctx current item torecipients ccrecipients =@ctx current item ccrecipients bccrecipients =@ctx current item bccrecipients replyto =@ctx current item replyto filter \ title focused value focused \ title other value other view email jigx title =@ctx jig inputs subject type jig default header type component jig header options height small children type component image options source uri https //blog smu edu/itconnect/files/2020/12/featured image email 354ca1 1 png children \ type component entity options children \ type component field row options children \ type component entity field options label from value =@ctx jig inputs sender emailaddress name \ type component entity field options label recieved value =$frommillis($tomillis(@ctx jig inputs receiveddatetime), '\[h] \[m01] \[pn]', @ctx system timezone offset) \ type component entity field options label to value =@ctx jig inputs torecipients emailaddress address \ type component web view options height 800 istrackingtransparencyrequired false content | \=(" \<html> \<head> \<style> body { font family arial; } \</style> \<meta name=" & "'" & "viewport" & "'" & " content=" & "'" & "width=device width, " & "initial scale=1" & "'" & "/> \</head> \<body>" & @ctx jig inputs body content & "\</body> \</html>")