I’m getting “undefined” when trying to access the property of an Object in the API response when setting the text value of a label, if I don’t use a List component. If I use a List component, I cannot get the text to change at all. Either way, I cannot access the property value. Please can someone help?
Here’s how it looks:
This is the URL being called: https://jsonplaceholder.typicode.com/comments?id=1
And this is the response:
“name”: “id labore ex et quam laborum”,
“body”: “laudantium enim quasi est quidem magnam voluptate ipsam eos\ntempora quo necessitatibus\ndolor quam autem quasi\nreiciendis et nam sapiente accusantium”
I know the URL works as I can set the text of the label to just be the raw response and this works every time. Screenshot of response in app and blocks if I just sent the label text to be the response
When the blocks are like this, the text of the label becomes “undefined”
When the blocks are like this, the text of the label does not change
I’ve tried replacing the get property “email” with a string block and typing in ‘email’, changing the list number/counter to 0 and 2 (in case there is an index issue) and a few other variations but I do not know how to access the property of an object.
Please could you advise what I’ve done wrong and how I can debug this (to help myself) so that I can get the object property value and use lists correctly with the API call?
Thanks in advance
PS. Full disclosure, I did originally open a topic on this here WebAPI Cannot access property which was marked as resolved but this was down to the API itself not working. Now the API is definitely up, I still cannot get the code to work hence the new thread. Thanks