title: View User Profile
description: Displays a user's profile information from Microsoft Graph
type: jig.default
icon: person
header:
type: component.jig-header
options:
height: small
children:
type: component.image
options:
source:
uri: https://support.content.office.net/en-us/media/f1c4b693-4670-4e7a-8102-bbf1749e83fe.jpg
onRefresh:
type: action.sync-entities
options:
provider: DATA_PROVIDER_REST
entities:
- entity: user-profile
function: get-user-profile
parameters:
accessToken: microsoft.OAuth
- entity: profile-picture
function: get-profile-picture
parameters:
accessToken: microsoft.OAuth
userId: =@ctx.user.email
- entity: user-emails
function: get-user-emails-addresses
parameters:
accessToken: microsoft.OAuth
datasources:
userProfile:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: user-profile
query: |
SELECT id,
'$.displayName',
'$.givenName',
'$.jobTitle',
'$.mail',
'$.mobilePhone',
'$.officeLocation',
'$.surname',
'$.userPrincipalName',
'$.businessPhones',
'$.id'
FROM [user-profile]
isDocument: true
profilePhoto:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: profile-picture
query: SELECT id, '$.userId', '$.data' FROM [profile-picture]
isDocument: true
userEmails:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: user-emails
query: SELECT id, '$.address', '$.type', '$.allowedAudiences' FROM [user-emails]
children:
- type: component.image
options:
source:
uri: =@ctx.datasources.profilePhoto.data
height: 200
resizeMode: contain
- type: component.entity
options:
children:
- type: component.entity-field
options:
label: Email
value: =@ctx.datasources.userProfile.mail
contentType: email
- type: component.entity-field
options:
label: User Principal Name
value: =@ctx.datasources.userProfile.userPrincipalName
- type: component.entity-field
options:
label: Display Name
value: =@ctx.datasources.userProfile.displayName
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Given Name
value: =@ctx.datasources.userProfile.givenName
- type: component.entity-field
options:
label: Surname
value: =@ctx.datasources.userProfile.surname
- type: component.field-row
options:
children:
- type: component.entity-field
options:
label: Job Title
value: =@ctx.datasources.userProfile.jobTitle
- type: component.entity-field
options:
label: Mobile Phone
value: =@ctx.datasources.userProfile.mobilePhone
- type: component.entity-field
options:
label: Office Location
value: =@ctx.datasources.userProfile.officeLocation
- type: component.section
options:
title: Email Addresses
children:
- type: component.list
options:
data: =@ctx.datasources.userEmails
maximumItemsToRender: 8
item:
type: component.list-item
options:
divider: solid
leftElement:
element: icon
icon: email
title: =@ctx.current.item.address
subtitle: |
="Type: " & @ctx.current.item.type
description: |
="Allowed Audiences: " & @ctx.current.item.allowedAudiences
actions:
- children:
- type: action.go-to
options:
title: Update Profile Picture
linkTo: update-profile-picture
widgets:
profileAvatar:
type: widget.group
options:
children:
- type: widget.avatar
options:
text: "Your Profile"
uri: =@ctx.datasources.profilePhoto.data
bottom:
type: component.titles
options:
align: center
title: =@ctx.datasources.userProfile.displayName
subtitle: =@ctx.datasources.userProfile.jobTitle
profileImage:
type: widget.image
options:
isContentOverlaid: true
source:
uri: =@ctx.datasources.profilePhoto.data
bottom:
type: component.titles
options:
title: =@ctx.datasources.userProfile.displayName
subtitle: =@ctx.datasources.userProfile.jobTitle