
I'm grabbing some data from Okta (our identidy provider) using their API, the aim is to get the member list of a group in Okta to be displayed in a Teams message.
The API returns the following which I'm putting through the 'Parse JSON' function in Flow.
[
{
"id": "xxxxxxxxxxxxxxxxxxx",
"status": "ACTIVE",
"created": "2018-08-13T13:15:40.000Z",
"activated": "2018-08-13T13:15:54.000Z",
"statusChanged": "2018-08-13T13:15:54.000Z",
"lastLogin": "2018-08-13T13:22:34.000Z",
"lastUpdated": "2020-08-20T15:15:02.000Z",
"passwordChanged": null,
"type": {
"id": "xxxxxxxxxxxxxxxxx"
},
"profile": {
"proxyAddresses": [
"smtp:email1@domain.com",
"SMTP:email2@domain.com"
],
"firstName": "xxxxx",
"lastName": "xxxxx",
"mobilePhone": null,
"displayName": "xxxxx",
"countryCode": "xx",
"secondEmail": null,
"CompanyToOkta": "xxxxx",
"login": "email1@domain.com",
"email": "email2@domain.com"
},
"credentials": {
"provider": {
"type": "ACTIVE_DIRECTORY",
"name": "adname.com"
}
},
"_links": {
"self": {
"href": "https://xxxxxx.okta.com/api/v1/users/xxxxxxxxxxxxxxxxxx"
}
}
},
{
"id": "xxxxxxxxxxxxxxxxxxx",
"status": "ACTIVE",
"created": "2017-07-19T10:36:45.000Z",
"activated": "2017-07-19T10:36:45.000Z",
"statusChanged": "2020-03-16T14:03:13.000Z",
"lastLogin": "2020-09-23T12:11:19.000Z",
"lastUpdated": "2020-07-31T06:41:11.000Z",
"passwordChanged": null,
"type": {
"id": "xxxxxxxxxxxxxxxxx"
},
"profile": {
"lastName": "xxxxxxxxxx",
"zipCode": "xxxxxx",
"city": "xxxxxxxxxxxxxxxx",
"displayName": "xxxxxxxxxxxxxx",
"secondEmail": null,
"title": "xxxxxxxxx",
"Manager": "xxxxxxxxxxxxxxxxxxx",
"CompanyToOkta": "xxxxxxxxxxxxxxxx",
"login": "email3@domain.com",
"proxyAddresses": [
"smtp:email4@domain.com",
"smtp:email5@domain.com",
"SMTP:email6@domain.com"
],
"firstName": "xxxxxxxxxxx",
"primaryPhone": "xxxxxxxxxxxxx",
"mobilePhone": null,
"streetAddress": "xxxxxxxxxxxxx",
"countryCode": "xx",
"department": "xxxxxxxxxxxxxxx",
"email": "email3@domain.com"
},
"credentials": {
"provider": {
"type": "ACTIVE_DIRECTORY",
"name": "adname.com"
}
},
"_links": {
"self": {
"href": "https://xxxxxx.okta.com/api/v1/users/xxxxxxxxxxxxxxxxxxx"
}
}
}
]
It's the displayName field I'm interested in. If I add the 'Post to Teams' function then as there's multiple displayNames returned Flow puts it into an 'Apply to each' which means if there's 2 members of the group we end up with 2 Teams messages being posted. What I'd like is a single message with each group member listed within that. Ideally on a new line, but a comma separator would also work.
I'm missing something here, but can't work out what. The displayName in the message is taken from the JSON parse. My current thinking is that I should use concat to form the body of the message but that's as far as I have got.
Any help would be much appreciated!