Question: REST get item metadata and load the values into fields
I am working on an edit form for SharePoint. My current process is that I am using a REST call to obtain the list item's current values. Once the REST call returns the values, the promise is resolved and the state is set to the response object that contains the item's columns along with the current column values. I then want to take those values and load them into the appropriate field on the React form. That is the part I am currently stuck on. Can someone please explain at a high level the correct method, order, or process for accomplishing this? Any help would be greatly appreciated.
Better to float such open questions over stackoverflow. Just to give you some pointers on approaches, it depends upon scale of your form and how the rest of the page is designed.
-
If it is a very simple form, you can create a container component that holds responsibility for REST call and pass down the results to appropriate components when ready, like something discussed at http://stackoverflow.com/questions/37486251/making-rest-calls-from-a-react-component
-
If your form data is aggregated and has many sources (Rest APIs). Its recommended to build your UI using Flux pattern. There are a bunch of flux implementations out there . If you want to create your own you can refer to https://github.com/cschleiden/vsts-markdown/tree/master/src
Thank you for the help! I apologize for posting in the wrong place.