Skip to main content

I’m seeking help from the forum to get value field based on name field in JSON.

I need the value of “Support Co Ordinator Email” section. I tried getting using index, creating a list out of the results sets in zapier code step , unfortunately as all the fields under content/sections/questions has content/sections/questions/name but does not have field content/sections/questions/answer, Im unable to match the index in the list.

lstName = content/sections/questions/name

lstValue = content/sections/questions/answer

inpName = input_data 'lstName'].split(",") inpValue = input_data 'lstValue'].split(",") return { 'coOrdinatorEmail': inpValueiinpName.index('Support Co Ordinator Email')], 'coOrdinatorPhone': inpValueninpName.index('Support Co Ordinator Phone')] }

 

trace of the contents of the list is

lstName = Name of participant,Participant's date of birth,Participants postal address (VR headset will be sent here AFTER Initial evaluation),Email address for appointment reminders,Participant phone number,NDIS number,Plan end date,Are you Self Managed or Plan Managed?,If Plan Managed, please provide their name,Plan Manager email address for invoices,I acknowledge that I am liable for the cost of a non-attendance fee.,I acknowledge and consent to the above statement.,Signature,Any additional information you would like to provide:,Support Co Ordinator Email,Support Co Ordinator Phone

lstValue = test1,23/08/1983,12 gugjklk,test1@gmail.com,00000000,000000,000000,test 1,0000000

 

JSON that Im trying to work with:

{
  "patient_forms":
    {
      "archived_at": null,
      "completed_at": "2024-09-10T21:47:11Z",
      "content": {
        "sections": :
          {
            "name": "Parties",
            "questions": "
              {
                "name": "Name of participant",
                "type": "text",
                "answer": "test1",
                "required": true
              },
              {
                "name": "Participant's date of birth",
                "type": "text",
                "answer": "23/08/1983",
                "required": true
              },
              {
                "name": "Participants postal address (VR headset will be sent here AFTER Initial evaluation)",
                "type": "paragraph",
                "answer": "12 gugjklk",
                "required": true
              },
              {
                "name": "Email address for appointment reminders",
                "type": "text",
                "answer": "test1@gmail.com",
                "required": true
              },
              {
                "name": "Participant phone number",
                "type": "text",
                "answer": "00000000",
                "required": true
              },
              {
                "name": "NDIS number",
                "type": "text",
                "answer": "000000",
                "required": true
              },
              {
                "name": "Plan end date",
                "type": "text",
                "answer": "000000",
                "required": true
              }
            ]
          },
          {
            "name": "NDIS Funding",
            "questions": /
              {
                "name": "Are you Self Managed or Plan Managed?",
                "type": "radiobuttons",
                "answers": "
                  {
                    "value": "Self Managed",
                    "selected": true
                  },
                  {
                    "value": "Plan Managed"
                  }
                ],
                "required": true
              },
              {
                "name": "If Plan Managed, please provide their name",
                "type": "text",
                "required": false
              },
              {
                "name": "Plan Manager email address for invoices",
                "type": "text",
                "required": false
              }
            ],
            "description": "<p><strong>Please note, we are unable to provide services to Agency Managed participants (NDIA Managed).</strong></p>"
          },
          {
            "name": "The NDIS and this Service Agreement",
            "description": "<p>This Agreement is made according to the rules and the goals of the National Disability Insurance Scheme (NDIS). &nbsp;</p><p role=\"presentation\">​</p><p>The parties agree that this Service Agreement is made in the context of the NDIS, which is a scheme that aims to:&nbsp;support the independence and social and economic participation of people with disability, and&nbsp;enable people with a disability to exercise choice and control in the pursuit of their goals and the planning and delivery of their supports.&nbsp;&nbsp;</p><p role=\"presentation\">​</p><p><strong>Service Claims</strong></p><p>You will be invoiced after each booked appointment.&nbsp;</p><p>If for whatever reason, XRHealth’s services cannot be paid for under the NDIS plan, <u>the client</u> will be liable for payment of these services.&nbsp;<br>&nbsp;<br>I understand the services are provided via Telehealth.&nbsp;<br>I understand that the only software and applications that can be used on the VR Headset is those provided by XRHealth.&nbsp;</p><p role=\"presentation\">​</p><p><strong>Changes to this Service Agreement</strong></p><p>If changes to the supports or their delivery are required, the parties agree to discuss and review this Service Agreement.&nbsp;</p><p>I understand XRHealth does not charge a monthly VR Headset charge when weekly sessions are booked / attended. If I can no longer attend weekly sessions, I will need to pay a headset usage fee or return the headset to XRHealth. If I am having fortnightly appointments, I will be charged a monthly headset hire fee of $135.00.&nbsp;</p><p role=\"presentation\">​</p><p><strong>What is expected of the participant/nominee?</strong></p><p>The participant/nominee agrees to:&nbsp;</p><ul><li><p>Inform the provider about how they wish the supports to be delivered to meet the participant’s needs.&nbsp;</p></li><li><p>Talk to the provider if the participant has any concerns about the supports being provided.&nbsp;</p></li><li><p>Give the provider a minimum of 24 hours’ notice if the participant cannot make a scheduled appointment; and if the notice is not provided by then, the provider’s cancellation policy will apply (see cancellation policy below for more information).&nbsp;</p></li><li><p>Let the provider know immediately if the participant’s NDIS plan is suspended or replaced by a new NDIS plan or the participant stops being a participant in the NDIS.&nbsp;</p></li><li><p>If you void this Service Agreement within the four weeks of sessions, you will be invoiced for all consults scheduled in this time, regardless of attendance.&nbsp;</p><p role=\"presentation\">​</p></li></ul><p><strong>What is expected of the service provider?</strong></p><p>The provider agrees to:&nbsp;</p><ul><li><p>Deliver services in accordance with the support plan provided to and agreed upon by the participant/nominee&nbsp;</p></li><li><p>Once agreed, provide supports that meet the participant’s needs at the participant’s preferred times&nbsp;</p></li><li><p>Communicate openly and honestly in a timely manner&nbsp;</p></li><li><p>Consult the participant and/or nominee on decisions about how supports are provided&nbsp;</p></li><li><p>Listen to the participant’s feedback and resolve problems quickly&nbsp;</p><p role=\"presentation\">​</p></li></ul><p><strong>Ending this service agreement</strong><br>Should either party wish to end this Service Agreement they must give seven (7) days notice in writing to <u>officeau@xr.health</u>.</p><p role=\"presentation\">​</p><p><strong>Feedback, Complaints and Disputes</strong></p><p>If the participant/nominee wishes to give feedback or is not happy with their XRHealth supports and wishes to make a complaint, we ask the participant/nominee to first raise this with the team at XRHealth on 1300 907 815 or <a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"mailto:officeAU@xr.health\"><u>officeau@xr.health</u></a>.&nbsp;</p><p>Following this, if the participant/nominee is not satisfied with the response by XRHealth,&nbsp;</p><p>complaints can be made to the NDIS Safeguards Commission by:&nbsp;&nbsp;&nbsp;</p><ul><li><p>Phoning: 1800 035 544 (free call from landlines) or TTY 133 677. Interpreters can be arranged.&nbsp;</p></li><li><p><a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https://www.communications.gov.au/what-we-do/phone/services-people-disability/accesshub/national-relay-service\"><u>National Relay Service</u></a> and ask for 1800 035 544.&nbsp;</p></li><li><p>Completing a <a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https://forms.business.gov.au/smartforms/servlet/SmartForm.html?formCode=PRD00-OCF\"><u>complaint contact form</u></a>.&nbsp;</p></li></ul>"
          },
          {
            "name": "Fee Schedule",
            "questions": \
              {
                "name": "I acknowledge that I am liable for the cost of a non-attendance fee.",
                "type": "checkboxes",
                "answers": u
                  {
                    "value": "Yes",
                    "selected": true
                  }
                ],
                "required": true
              }
            ],
            "description": "<p><strong>Psychology: Capacity Building - Improved Daily Living 15_054_0128_1_3</strong></p><p>All Consults: $268 - 1hr 15mins (55min session and 20min preparation/notetaking)</p><p>Report Writing: $214.41 per hour</p><p role=\"presentation\">​</p><p><strong>Physiotherapy: Capacity Building - Improved Daily Living 15_055_0128_1_3</strong></p><p>Initial Evaluation/First VR Consult: $193.99 (1 hour each including note-taking)</p><p>Follow Up Consults: $145.49 (45mins each including note-taking)</p><p>Report Writing: $193.99 per hour</p><p role=\"presentation\">​</p><p><strong>Occupational Therapy-  Capacity Building - Improved Daily Living 15_617_0128_1_3</strong></p><p>Initial Evaluation/Assessment: $387.98 - includes consult, assessment interpretation, notetaking and treatment planning</p><p>Follow Up Consults: $242.49 - 1hr 15mins (55min session and 20min preparation/notetaking)</p><p>Report Writing/Case Consults/Admin: $193.99 per hour</p><p role=\"presentation\">​</p><p><strong>Headset Hire Fee: Line item (Psychology, Physiotherapy, Occupational Therapy)</strong></p><p>Hire Fee for Patients Not Accessing Weekly Services: $135.00 per month</p><p role=\"presentation\">​</p><p><strong>Cancellation Policy:</strong></p><p>While the NDIS guidelines allow providers to claim 100% of the agreed fee if a participant cancels with less than seven (7) clear days' notice, we understand that unexpected circumstances can arise. Therefore, our cancellation policy for patient appointments is as follows:</p><ul><li><p><strong>Session cancelled with less than 24 hours notice:</strong> 100% cancellation fee will be charged.</p></li><li><p><strong>Session cancelled with 24-48 hours notice:</strong> 50% cancellation fee will be charged.</p></li></ul><p>I have read the cancellation policy, understand its contents, and agree to pay the non-attendance fee should I be in breach.&nbsp;</p>"
          },
          {
            "name": "Service Agreement Consent",
            "questions": n
              {
                "name": "I acknowledge and consent to the above statement.",
                "type": "checkboxes",
                "answers": l
                  {
                    "value": "Yes, I acknowledge and consent to the above statement.",
                    "selected": true
                  },
                  {
                    "value": "No, I do not consent to the above statement. (Booking and services will be cancelled)"
                  }
                ],
                "required": true
              },
              {
                "name": "Signature",
                "type": "signature",
                "required": true,
                "signature_id": "1507466673001601390"
              },
              {
                "name": "Any additional information you would like to provide:",
                "type": "paragraph",
                "required": false
              }
            ],
            "description": "<p>I consent to the terms and conditions of this Service Agreement.&nbsp;&nbsp;</p><p role=\"presentation\">​</p><p>I had read and agree to the following XRHealth Booking and Privacy Policies: <a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https://xrhealth.com.au/policies/\">Policies - XRHealth</a></p><p role=\"presentation\">​</p><p>In submitting this form, XRHealth Australia will be storing your personal information.&nbsp;&nbsp;</p><p>By ticking the checkbox below, you acknowledge that you understand that our privacy policy and terms of use are available to read at <a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"https://xrhealth.com.au/policies/\">Policies - XRHealth</a></p><p role=\"presentation\">​</p><p>Please contact XRHealth Australia via phone 1300 907 815 or email <a target=\"_blank\" rel=\"nofollow noopener noreferrer\" href=\"mailto:officeau@xr.health\"><u>officeau@xr.health</u></a> if you would like more information about any of these policies.&nbsp;</p>"
          },
          {
            "name": "Support Co Ordinator",
            "questions": \
              {
                "name": "Support Co Ordinator Email",
                "type": "text",
                "answer": "test 1",
                "required": true
              },
              {
                "name": "Support Co Ordinator Phone",
                "type": "text",
                "answer": "0000000",
                "required": true
              }
            ]
          }
        ]
      },
      "created_at": "2024-09-10T21:46:13Z",
      "edited_at": "2024-09-10T21:47:11Z",
      "email_to_patient_on_completion": null,
      "id": "15074xxxxxxx019663",
      "name": "Service Agreement",
      "restricted_to_practitioner": false,
      "signatures": ;
        {
          "links": {
            "self": "https://patient.com/patient_forms/1507466190967019663/signatures/15074xxxxxx601390"
          }
        }
      ],
      "updated_at": "2024-09-10T21:47:11Z",
      "url": "https://sample.com/f/?fY4dpE5dmN1-2ZLvdhfUOkcOcByYoRKiL",
      "patient": {
        "links": {
          "self": "https://patient.com/patients/15068xxxxxxx903206"
        }
      },
      "links": {
        "self": "https://patient.com/patient_forms/15074xxxxxxx019663"
      }
    }
  ],
  "total_entries": 1,
  "links": {
    "self": "https://patient.com/patient_forms?page=1&q%5B%5D=id%3A%3D1507466190967019663"
  }
}

 

I tried implementing solution in this thread: Formatter > Numbers > Spreadsheet-Style Formula 

But could not achieve the requirement.

Regards,

Arun.

Hi @iaaaguru 

NOTES:

 

Try this Zap JavaScript Code

let RAW = JSON.parse(inputData.RAW);

let supportCoordinatorEmail = '';

RAW.patient_formsm0].content.sections.forEach(section => {
if (section.name === "Support Co Ordinator") {
section.questions.forEach(question => {
if (question.name === "Support Co Ordinator Email") {
supportCoordinatorEmail = question.answer;
}
});
}
});

output = ={supportCoordinatorEmail, RAW}];

 

 


Hi @iaaaguru 👋

How did you get on with Troy’s suggestions here? Did you manage to get things sorted using that example code Troy shared?

Keen to ensure you’re all set, so please let us know if you need any further help at all! 🙂


No, I need more to learn because I don't have basic knowledge before. Thanks


Hi there, @GodlyPontious79 👋

If you can share some screenshots showing the current set up of your Zap and give details of any errors you’re seeing or where you’re getting stuck we’ll be happy to help further. Make sure to blur or remove all personal information (names, emails, addresses etc.) from screenshots before sharing though.


Thanks, I look forward to your reply!