---
title: "Discussion on \"How do I build a dynamic dependent select form using react+redux, as we are receiving data from backend API?\" | Hashnode"
description: "Discussion on \"How do I build a dynamic dependent select form using react+redux, as we are receiving data from backend API?\". We are receiving the data from the backend API to load up the same in our select form.\nThere going to be multiple dynamic dependent select fields in the form.\nOnce we select the value in the first field the second one loads up the data associated wit..."
url: "https://hashnode.com/posts/how-do-i-build-a-dynamic-dependent-select-form-using-reactredux-as-we-are-receiving-data-from-backend-api/5dce4d9f2bd452a26a21547e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How do I build a dynamic dependent select form using react+redux, as we are receiving data from backend API?](https://isubhokarma.hashnode.dev/how-do-i-build-a-dynamic-dependent-select-form-using-reactredux-as-we-are-receiving-data-from-backend-api?utm_source=hashnode&utm_medium=feed)

We are receiving the data from the backend API to load up the same in our select form. There going to be multiple dynamic dependent select fields in the form. Once we select the value in the first field the second one loads up the data associated wit...

Nov 15, 2019 · isubhokarma.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#redux](https://hashnode.com/tag/redux)
-   [#forms](https://hashnode.com/tag/forms)
-   [#axios](https://hashnode.com/tag/axios)

## Written by

[Subho Karmakar](https://hashnode.com/@isubhokarma)

@isubhokarma

  
[View profile](https://hashnode.com/@isubhokarma)

## Responses 1

Markdown supported · ⌘↵ to post

[Omprakash Sridharan](https://hashnode.com/@omprakashsridharan)

[Nov 17, 2019](https://hashnode.com/posts/how-do-i-build-a-dynamic-dependent-select-form-using-reactredux-as-we-are-receiving-data-from-backend-api/5dce4d9f2bd452a26a21547e/comment/5dd0e5848e84d69d6afc7d3b)

You can use javascript's compute property capabilities. Let's say you want to dynamically select the district based on the state. Construct a json describing your conditions.

```
[
  {
    "fieldName":"state",
    "dependentOn":null
  },
{
    "fieldName":"district",
    "dependentOn":"state" //this name should be same as that of mapStateToProps
  },
{
    "fieldName":"city",
    "dependentOn":"district"
  },
]
```

Iterate over the above to create react elements and for each you can access the values using selectors. ex:

```
const getDistrictsByState = (currentState) => {
  return (state)=>state[currentState] //computed at runtime
}
```

Hope this gives you some idea :)
