Data Providers
...
MS Graph
Graph tasks
Get To-do lists & tasks
6min
Get a list of To-do tasks for a user in Microsoft Graph using a GET REST function and display the tasks in a list .
Resource links:
Required OAuth scope (least to most privilege):
Tasks.Read Tasks.ReadWrite
Task list
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
widgets:
- size: 2x2 # choose size of the widget on the home hub
jigId: view-user-jigx
- size: "2x2"
jigId: calendar-summary
- size: "4x2"
jigId: next-meeting
when: |
[email protected]=null? false:true
- size: "2x2"
jigId: list-email-messages
- size: "2x2"
jigId: list-task-lists
- size: "4x2"
jigId: items-trending
onFocus:
type: action.action-list
options:
isSequential: true
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: user-profile
function: get-user-profile
functionParameters:
accessToken: microsoft.OAuth
- entity: profile-picture
function: get-profile-picture
functionParameters:
accessToken: microsoft.OAuth
userId: [email protected]
- entity: user-emails
function: get-user-emails-addresses
functionParameters:
accessToken: microsoft.OAuth
- entity: items-trending
function: get-items-trending
functionParameters:
accessToken: microsoft.OAuth
- entity: next-week-calendar-events
function: get-calendar-events-next-week
functionParameters:
accessToken: microsoft.OAuth
startdatetime: =$fromMillis($millis())
enddatetime: =$fromMillis($millis()+604800000)
- entity: calendars
function: get-calendar-list
functionParameters:
accessToken: microsoft.OAuth
- entity: todo-task-lists
function: get-task-lists
functionParameters:
accessToken: microsoft.OAuth
- entity: email-messages
function: get-email-messages
functionParameters:
accessToken: microsoft.OAuth
$filter: ="receivedDateTime ge " & $fromMillis($millis()-432000000)
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: todo-tasks
function: get-all-todo-tasks
functionParameters:
accessToken: microsoft.OAuth
taskListIds: |
={
"requests": $map(@ctx.datasources.task-lists.id, function($v, $i, $a) {
{
"id": $string($i + 1),
"method": "GET",
"url": "me/todo/lists/" & $v & "/tasks?$top100",
"dependsOn": $i>0? [$string($i)]
}
})
}
onRefresh:
type: action.action-list
options:
isSequential: true
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: todo-task-lists
function: get-task-lists
functionParameters:
accessToken: microsoft.OAuth
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: todo-tasks
function: get-all-todo-tasks
functionParameters:
accessToken: microsoft.OAuth
taskListIds: |
={
"requests": $map(@ctx.datasources.task-lists.id, function($v, $i, $a) {
{
"id": $string($i + 1),
"method": "GET",
"url": "me/todo/lists/" & $v & "/tasks?$top100",
"dependsOn": $i>0? [$string($i)]
}
})
}
MS Graph list To-do tasks function in GitHub.
get-all-todo-tasks.jigx
get-task-lists.jigx
provider: DATA_PROVIDER_REST
method: GET
url: https://graph.microsoft.com/v1.0/me/todo/lists
outputTransform: $
parameters:
accessToken:
location: header
required: true
type: string
value: microsoft.OAuth #Use manage.jigx.com to define credentials for your solution
$top:
type: string
location: query
required: false
value: 100
records: =$.value
continuation:
when: =$."@odata.nextLink"
url: =$."@odata.nextLink"
parameters:
accessToken:
location: header
required: true
type: string
value: microsoft.OAuth
errorTransform: |
{
"error": "No lists"
}
MS Graph list To-do tasks in GitHub.
list-task-lists.jigx
title: Task Lists
type: jig.list
icon: contact
header:
type: component.jig-header
options:
height: small
children:
type: component.image
options:
source:
uri: https://www.windowslatest.com/wp-content/uploads/2018/12/Office-apps-new-icons.jpg
onRefresh:
type: action.action-list
options:
actions:
- type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: todo-task-lists
function: get-task-lists
functionParameters:
accessToken: microsoft.OAuth
datasources:
mydata:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: todo-task-lists
- entity: todo-tasks
query: SELECT json_extract(tlists.Data, '$.id') as tlId, json_extract(tlists.Data, '$.displayName') as tlDisplayName,
json_extract(tlists.Data, '$.isOwner') as isOwner, count(json_extract(tasks.Data, '$.id')) AS task_count
FROM [todo-task-lists] tlists
LEFT JOIN [todo-tasks] tasks ON json_extract(tlists.Data, '$.id') = json_extract(tasks.Data, '$.toDoListId')
Group by json_extract(tlists.Data, '$.id'),json_extract(tlists.Data, '$.displayName')
order by task_count desc
data: [email protected]
item:
type: component.list-item
options:
title: [email protected]
leftElement:
element: icon
icon: task-list
divider: solid
rightElement:
element: icon
icon: arrow-right
subtitle: |
[email protected]? "Owner of the list: Yes":"Owner of the list: No"
label:
title: |
[email protected]_count
widgets:
"2x2":
type: widget.list
options:
data: [email protected]
item:
type: component.list-item
options:
title: [email protected]
leftElement:
element: icon
icon: task-list
divider: solid
subtitle: |
="Number of Tasks: " & @ctx.current.item.task_count
Updated 03 May 2024
Did this page help you?