# Configuring the components

## Procedure

1. Double-click tFileInputJSON to display its Basic settings view.
2. Click Edit schema to open the schema editor.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_2_3.png)

   Click the [+] button to add one column, namely *friends*, of the String type.

   Click OK to close the editor.
3. Click the [...] button to browse for the JSON file, *facebook.json* in this case:
   ```
   { "user": { "id": "9999912398",
               "name": "Kelly Clarkson",
               "friends": [
                    { "name": "Tom Cruise",
                      "id": "55555555555555",
                      "likes": {
                          "data": [
                               { "category": "Movie",
                                 "name": "The Shawshank Redemption",
                                 "id": "103636093053996",
                                 "created_time": "2012-11-20T15:52:07+0000"
                               },
                               { "category": "Community",
                                 "name": "Positiveretribution",
                                 "id": "471389562899413",
                                 "created_time": "2012-12-16T21:13:26+0000"
                               }
                                   ]
                               }
                    },
                    { "name": "Tom Hanks",
                      "id": "88888888888888"
                      "likes": {
                           "data": [
                               { "category": "Journalist",
                                 "name": "Janelle Wang",
                                 "id": "136009823148851",
                                 "created_time": "2013-01-01T08:22:17+0000"
                               },
                               { "category": "Tv show",
                                 "name": "Now With Alex Wagner",
                                 "id": "305948749433410",
                                 "created_time": "2012-11-20T06:14:10+0000"
                               }
                               ]
                              }
                     }
                           ]
             }
   }
   ```
4. Select JsonPath without loop from the Read By drop-down list.
5. Enter "$.user.friends[\*]" in the JSONPath query column next to the friends column in the Mapping table.

   The JSONPath query entered in this table retrieves the entire *friends* nodes from the source file.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_2_2.png)
6. Double-click tExtractJSONFields to display its Basic settings view.
7. Click Edit schema to open the schema editor.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_2_5.png)
8. Click the [+] button in the right panel to add five columns, namely *id*, *name*, *like\_id*, *like\_name* and *like\_category*, which will hold the data of relevant nodes in the JSON field *friends*.

   Click OK to close the editor.
9. In the pop-up Propagate box, click Yes to propagate the schema to the subsequent components.

   ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_13.png)
10. Enter "/likes/data" in the Loop XPath query field.
11. In the Mapping area, type in the queries of the JSON nodes in the XPath query column. The data of those nodes will be extracted and passed to their counterpart columns defined in the output schema.
12. Specifically, define the XPath query *"../../id"* (querying the *"/friends/id"* node) for the column *id*, *"../../name"* (querying the *"/friends/name"* node) for the column *name*, *"id"* for the column *like\_id*, *"name"* for the column *like\_name*, and *"category"* for the column *like\_category*.

    ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_2_4.png)
13. Double-click tLogRow to display its Basic settings view.

    ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/use_case_textractjsonfields_11.png)
14. Select Table (print values in cells of a table) for a better display of the results.