RUNTIME ERROR: Parsing JSON and foreach loop

I was working on my application in MIT when I ran ito a runtime error. The runtime error that I encountered was lookup in pairs the list is not a well-formed list. I worked on this earlier and I was able to display the JSON data that I fetched using php but the problem is that I am only getting one data instead of all data. That's why I used foreach then I ran into the error. I am still beginner in MIT so i hope you can help me.


Foreah position, I want to display the candidates name in a checkbox.

Show you example json output

Please capture your responseContent as text and paste the text to this thread to allow us to compare the JSON text against your parse attempts.

[{"position":"Governor","candidates":[{"candidateId":76,"candidateName":"Candidate One","candidateParty":"LOL"},{"candidateId":77,"candidateName":"Candidate Two","candidateParty":"OKAY"}]},{"position":"Board Member","candidates":[{"candidateId":80,"candidateName":"Candidate Twelve","candidateParty":"OKAY"}]}]

This is the output when I ran the php file I used.

Longhand (for Governor):

Could be simplified with a "walking at key path" block

Oh thanks. Let me try that one. Hopefully, it will work this time. I will be back.

Update: It's working! But my problem now is that only one candidate is being displayed. And would it be possible to remove the [""] in the data being displayed?


If you want to build a list using labels:

image

Also see here:

If you aim is a voting form, then you may need something quite different.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.