Skip to content

Commit ecc460d

Browse files
authored
Merge pull request #112141 from yoelhor/patch-38
Update json-transformations.md
2 parents a964da8 + 57c88e1 commit ecc460d

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

articles/active-directory-b2c/json-transformations.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: celestedg
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: reference
12-
ms.date: 12/10/2019
12+
ms.date: 04/21/2020
1313
ms.author: mimart
1414
ms.subservice: B2C
1515
---
@@ -219,6 +219,39 @@ In the following example, the claims transformation extracts the `id` element fr
219219
- Output claims:
220220
- **extractedClaim**: 6353399
221221

222+
## GetSingleItemFromJson
223+
224+
Gets the first element from a JSON data.
225+
226+
| Item | TransformationClaimType | Data Type | Notes |
227+
| ---- | ----------------------- | --------- | ----- |
228+
| InputClaim | inputJson | string | The ClaimTypes that are used by the claims transformation to get the item from the JSON data. |
229+
| OutputClaim | key | string | The first element key in the JSON. |
230+
| OutputClaim | value | string | The first element value in the JSON. |
231+
232+
In the following example, the claims transformation extracts the first element (given name) from the JSON data.
233+
234+
```XML
235+
<ClaimsTransformation Id="GetGivenNameFromResponse" TransformationMethod="GetSingleItemFromJson">
236+
<InputClaims>
237+
<InputClaim ClaimTypeReferenceId="json" TransformationClaimType="inputJson" />
238+
</InputClaims>
239+
<OutputClaims>
240+
<OutputClaim ClaimTypeReferenceId="givenNameKey" TransformationClaimType="key" />
241+
<OutputClaim ClaimTypeReferenceId="givenName" TransformationClaimType="value" />
242+
</OutputClaims>
243+
</ClaimsTransformation>
244+
```
245+
246+
### Example
247+
248+
- Input claims:
249+
- **inputJson**: {"givenName": "Emilty", "lastName": "Smith"}
250+
- Output claims:
251+
- **key**: givenName
252+
- **value**: Emilty
253+
254+
222255
## GetSingleValueFromJsonArray
223256

224257
Gets the first element from a JSON data array.
@@ -290,3 +323,5 @@ Output claim:
290323
}
291324
}
292325
```
326+
327+

0 commit comments

Comments
 (0)