1

enter image description here

I am able to get data in react JSON object, now I want to convert the JSON to string data and display into the page, Please find the below screenshot.

export const QvcPollsTab = () => {
    
    const [spData, setSpData] = useState<string>();
   -------------------------------------------------------

return (        
        <Provider theme={theme}>          
                
                <Flex.Item>
                    <div>
                        <div>
                            <Text content={`Hello test ${spData}`} />
    ------------------------------------------------------------

I can see the json data as is attached in image, but i am not able to iterate the data and display individual field like fields values.

I can see the JSON data as is attached in image, but I am not able to iterate the data and display individual field like fields values. Please help.

1 Answer 1

0

You cannot directly bind the JSON object to DOM element. You have to loop through the list items & then bind individual property to DOM.

Check below article for detailed information: SharePoint Framework: Retrieve and Display SharePoint List Items using REST API and React JS

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.