1
[
  {
    "docId": "58d8f38cd2f554fdfca4fd18",
    "__v": 8,
    "clinicDetails": {
      "5908e342236dee7e7364698e": {
        "appointmentSlots": {
          "sat": {
            "5908e342236dee7e73646a44": {
              "bookFlag": true,
              "endTime": "07:00PM",
              "startTime": "06:30PM"
            },
            "5908e342236dee7e73646a43": {
              "bookFlag": true,
              "endTime": "06:30PM",
              "startTime": "06:00PM"
            },
.......

full file : https://docs.google.com/document/d/1FK1NEY1Vmjzv2gBtleFquA0VMpfYGf9FaMyblPr8vws/edit?usp=sharing

I need to access these appointment slot ids like 5908e342236dee7e73646a44, so that I can send it in an API request

I am using angular.

0

1 Answer 1

1

Try to use

var jsonObject = angular.fromJson(yourJsonString)

That will transform your Json to an object. Then you can iterate over any field of the object an get keys or values.

angular.forEach(jsonObject.whatever, function(value, key) {
  console.log('key : ', key);
  console.log('value : ', value);
});
Sign up to request clarification or add additional context in comments.

Comments

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.