JSON Body with AppSheet Expressions - Syntax Assistance Needed

I need a little help with learning how to wrap AppSheet expressions inside JSON body text.

I currently have a handful of automations that send messages to internal chats, extracting certain information from records to place within the body of the messages. Here's one for example:

{
    "text": "*<<[Patient Name]>>*  was discharged from *<<[Hospital]>>* on <<[Discharge Date]>>.\n*DOB:* <<[DOB]>>
\n*Phone:* <<[_patientIdentifier].[Phone]>>\n\n*Timestamp:* <<[recordTimestamp]>>\n
*By:* <<[Provider]>>   \n\n*Follow Up:*  <<[_patientIdentifier].[Follow Up]>> \n*Follow Up Notes:* <<[_patientIdentifier].[Follow Up Notes]>>\n\n*Patient Flags:* <<[_patientIdentifier].[Flags]>> \n\n*Signout Notes:* <<[_patientIdentifier].[Signout Notes]>>"
}

What i'd like to know is how to truncate certain information if a field is blank. For example, a conditional statement if ISBLANK([Follow Up) returns true, then <insert text here>, otherwise, <insert alternative text here>

0 2 65
2 REPLIES 2

I think i may have this sorted with something like this:

{
    "text": "*<<[Patient Name]>>*  was discharged from *<<[Hospital]>>* on <<[Discharge Date]>>.
    \n*DOB:* <<[DOB]>>
\n*Phone:* <<[_patientIdentifier].[Phone]>>
\n\n*Timestamp:* <<[recordTimestamp]>>
\n*By:* <<[Provider]>>   
\n\n*Follow Up:*  <<[_patientIdentifier].[Follow Up]>> 
<<If: (ISNOTBLANK([_patientIdentifier].[Follow Up Notes]))
\n*Follow Up Notes:* <<[_patientIdentifier].[Follow Up Notes]>>
<<EndIf>>
\n\n*Patient Flags:* <<[_patientIdentifier].[Flags]>>
\n\n*Signout Notes:* <<[_patientIdentifier].[Signout Notes]>>"
}

Yes, Template If is the answer

Use If expressions in templates - AppSheet Help

Top Labels in this Space