I have an array called "Crops" that contains, among other values, the US State Abbreviations. The array looks like this:
[
{
"Crop": "Asparagus",
"Planted_Acres": 0.02,
"State_Abbrv": "AK",
"State":"XX"
},
{
"Crop": "Barley",
"Planted_Acres": 4973.51,
"State_Abbrv": "AK",
"State":"XX"
},
{
"Crop": "Beans",
"Planted_Acres": 0.11,
"State_Abbrv": "AK",
"State":"XX"
},
{
"Crop": "Beets",
"Planted_Acres": 0.06,
"State_Abbrv": "AK",
"State":"XX"
},
{
"Crop": "Broccoli",
"Planted_Acres": 0.04,
"State_Abbrv": "AK",
"State":"XX"
},
...
I have another array called "StatesAbbreviations" that looks like this:
[
{
"name": "Alabama",
"abbreviation": "AL"
},
{
"name": "Alaska",
"abbreviation": "AK"
},
...How can I loop through the Crops array, and change the values of "State" to the StatesAbbreviations name so it would look like this?
[
{
"Crop": "Asparagus",
"Planted_Acres": 0.02,
"State_Abbrv": "AK",
"State":"Arkansa"
},
{
"Crop": "Barley",
"Planted_Acres": 4973.51,
"State_Abbrv": "AK",
"State":"Arkansa"
},Any help would be appreciated. Thanks in advance.

Report
All responses (
Answers (