title: Extract data from JSON list in React native
body: <p>I want to parse a JSON file and display some data on the screen. I am able to display all the data using the following code, but I want to display only <code>entryDate</code> and <code>sysol</code>. Is it possible to use a for loop in <code>_onPressButtonGET()</code> and display data there only?</p>
  
  <pre><code>       import React, { Component } from 'react';
          import {
            AppRegistry,
            StyleSheet,
            Text,
            View,
            Navigator,
            TouchableOpacity,
            Image,
            TouchableHighlight,
            Alert,
            TextInput
          } from 'react-native';
          import Button from 'react-native-button'
          import {Actions} from 'react-native-router-flux'
          import Home from './Home'
  
          export class Temp extends Component{
          constructor(props) {
            super(props);
          this.state = {
              data: '',
              data1:'',
              textinput:'',
              entryDate:[]
  
            }
             state={
                      shouldShow: false
                  }
          }
  
              componentDidMount(){
              this._onPressButtonGET();
            } 
  
                _onPressButtonPOST(){
                  fetch(URL, {
                      method: "POST",  
                       headers: { 
                           'Accept': 'application/json',
                           'Content-Type': 'application/json',
                       },
                      body: JSON.stringify({
                          "entryDate":"3/2/2017 2:00 AM", 
                          "systol": this.state.textinput,
                          "mobileType":"ANDROID",
                          "userName":"menutest",
  
                         })})
                  .then((response) =&gt; response.json())
                  .then((responseData) =&gt; {
                      Alert.alert(                              
                          "Blood pressure data",
                          "Blood pressure data - " + JSON.stringify(responseData)
                      )
                  }).catch((error) =&gt; {
                      Alert.alert('problem while adding data');
                  })
                  .done(); 
              }
  
              _onPressButtonGET(){
                  fetch(url, {
                      method: "POST",
                       headers: {
                           'Accept': 'application/json',
                           'Content-Type': 'application/json',
                       },
                      body: JSON.stringify({"mobileType":"ANDROID","userName":"menutest"})})
                  .then((response) =&gt; response.json())
                  .then((responseData) =&gt; {
  
  
                          this.setState({ data : JSON.stringify(responseData) })
  data["list"].map(d =&gt; this.state.entryDate.push(d.entryDate));
  
  
                          this.setState({ entryDate: jsonResponse.entryDate, systol: responseData.systol })
  
  
                      }).catch((error) =&gt; {
                      Alert.alert('problem while getting data');
                  })
                 .done();
              }
              render(){
                  return(
  
                      &lt;View&gt;
                          &lt;TouchableHighlight onPress={this._onPressButtonPOST.bind(this)}&gt;
                              &lt;Text&gt;Add&lt;/Text&gt; 
                          &lt;/TouchableHighlight&gt;
  
                      &lt;TouchableOpacity style= {{left:300,top:-20, }}
           onPress={()=&gt;{ this.setState({ shouldShow: !this.state.shouldShow })}}
          &gt;&lt;Text&gt;Edit&lt;/Text&gt;&lt;/TouchableOpacity&gt;
  
          {this.state.shouldShow ? &lt;TextInput placeholder='systol' 
                      onChangeText={(text) =&gt; this.setState({textinput: text})}
                     /&gt; : null}
  
                           &lt;TouchableHighlight onPress={this._onPressButtonGET.bind(this)}&gt;
                              &lt;Text&gt;show&lt;/Text&gt;
                             &lt;/TouchableHighlight&gt;
  this.state.entryDate.map( d =&gt; (&lt;Text&gt;{d}&lt;/Text&gt;));
                             &lt;Text&gt;{this.state.entryDate}&lt;/Text&gt; //not displaying anythong
                         &lt;Text&gt;{this.state.data &amp;&amp; JSON.parse(this.state.data)['entryDate']}&lt;/Text&gt; //not displaying anything
                          &lt;Text&gt;hello{this.state.data}&lt;/Text&gt; //printing all data 
                      &lt;/View&gt;
              );
              }
          }
  
  
          module.exports = Temp;
  </code></pre>
  
  <p>JSON:</p>
  
  <pre><code>{
    "List": [
      {
        "entryDate": "03/02/2017",
        "entryDateTime": "03/02/2017 2:00 AM",
        "entryTime": "2:00 AM",
        "systol": "120"
      },
      {
        "entryDate": "03/02/2017",
        "entryDateTime": "03/02/2017 2:00 AM",
        "entryTime": "2:00 AM",
        "systol": "120"
      }
    ]
  }
  </code></pre>