Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • hello, I tried it but it still returns null. Also, there is no option .first[ ]. What do you mean with that. thanks Commented Nov 23, 2021 at 8:16
  • Try to force cast it (as, without ?) and post the error message here. If cast is successful, the result should be map. Map has .values.first property which returns first element (same as values.[0]). I've updated the code for map (was for array before, sorry). Commented Nov 23, 2021 at 8:27
  • hello, 'theData.values.first()' method is available but 'theData.values.first["time"]' this one is not available. 'theData.values.first()' this method return the first element of the array which is {patientUid=null, isBooked=false, time=1637868400000}. I want to reach time key under every object. thanks for your support. Commented Nov 23, 2021 at 8:45
  • I've updated the code to get time. Check the main answer. Commented Nov 23, 2021 at 8:50
  • hi, if you mean the update "theData.values.first()["time"]" this code, it is not working. after the first() method, it does not accept ["time"] . Commented Nov 23, 2021 at 9:00