0

Help with a simple formula!

I need help with a button!

 

The purpose of the button is to notify a family member to check their email for a photo we sent to their child’s primary physician with an update.

 

All of the fields are working - except the primary physician.

 

A child might have several physicians (specialists) but only one will be the primary. That physician is marked as the primary via a button. (screenshot attached)

Screen Shot 2022-01-31 at 3.07.38 PM 

I just want to be able to send test message that says:

 

“Hello (parent), please check your mailbox for a photo of (patient) that we sent to (PRIMARY PHYSICIAN) with an update.”

 

I’ve tried all manner of formulas to get this to sort but without success. As with nearly every question I submit here, I know that the answer is simple puts my lack of basic skills on display.

 

Here is the formula I am using now, which returns (of course) the names of all physicians associated with the patient:

 

openURL("sms:" + 'Guardian 01 Phone 1' + "&body=" + "Hello" + " " + 'Guardian 01 First Name' + "," + " " + "this is Pete from BrightStart Pediatrics. Check your email for a recent photo of" + " " + 'Patient First Name' + " " + "that we sent to Dr." + " " + 'Physicians and associated practices'.Contact.'Last Name' + " " + "with an update.”)

 

Here is a screenshot of that formula build, if it is helpful in understand how I’m missing the obvious.

Screen Shot 2022-01-31 at 3.06.36 PM 

Can anyone assist me with this?

2 replies

null
    • Danjamesmedia
    • 2 yrs ago
    • Reported - view

    Replace your highlighted code in the screenshot with 

    first('Physicians and associated practices'['Primary Physician' = true]).Contact.'Last Name'

     

    Explained:

    - first() grabs one record, as there are multiple records in the "link from" table/field

    - the square brackets filter the multiple results where 'Primary Physician' is checked "true".

    - Once that record has been found, outside of the first(), we can then grab the contact.Last Name

    • Pete_Stoll
    • 2 yrs ago
    • Reported - view

    AAHHHHH! Thank you, Dan!

    Of course, that works! I have not had to make changes to this database since I put it together about two or three years ago. Now I'm fixing a few little things and I seem to know less than when I put it together!

    Thank you so much, my friend!

    Best regards,

    Pete.

Content aside

  • 2 yrs agoLast active
  • 2Replies
  • 101Views