# Run Script by Response to SMS Message

**URL:** <https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [October 27, 2023, 6:40pm UTC](https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113 "2023-10-27T18:40:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 27, 2023, 6:40pm UTC](https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113/1 "2023-10-27T18:40:37Z")

</div>

Using the SMS module, is there a way to run a script after prompting for a specific response, in addition to the default 'reply ##### to acknowledge'?

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [October 27, 2023, 6:44pm UTC](https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113/2 "2023-10-27T18:44:18Z")

</div>

This thread may be related to your question:

> [@Alarm Pipeline SMS - Receive textmessage string](https://forum.inductiveautomation.com/t/alarm-pipeline-sms-receive-textmessage-string/67677/2):
>
> No, this isn't possible. SMS alarming is not flexible in this way. This would require a custom module and a significant amount of engineering effort.

I'm not sure anything has changed since late 2022, but if it has hopefully Ignition staff can chime in.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 27, 2023, 6:52pm UTC](https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113/3 "2023-10-27T18:52:56Z")

</div>

No, nothing has changed.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [October 28, 2023, 2:47am UTC](https://forum.inductiveautomation.com/t/run-script-by-response-to-sms-message/81113/4 "2023-10-28T02:47:32Z")

</div>

Been thinking about this one since I posted it. I have an idea. Anyone feel free to poke holes in it.

1. Create an 'after hours remote reset' tag that enables/disables this mode.
2. Create a new pipeline, dedicated to this mode.
3. 2 expression tags  
a. `totalAckd` - use `runScript` to get the number of acknowledged alarms. Run on a periodic basis. Configure an alarm with a relatively high active delay (maybe user-configurable) to fire when the value is greater than 0; sent to the new pipeline. Use an `alarmAcknowledged` script when ackd to record the number of 'known' acknowledged alarms.  
b. `unknownAckd` - difference between 'known' acknowledged alarms and total acknowledged alarms. Use an `alarmAcknowledged` script on this one when ackd to perform the 'remote reset' (whatever that may be).  
c. Replying to the `totalAckd` alarm would end up clearing the `unknownAckd` alarm condition because `totalAckd = knownAckd` (`unknownAckd` = 0).

This way, normal alarms still go out and can be acknowledged during the day and handled normally.

After hours (when enabled) they'll still get normal alarms but also get the 'totalAckd' alarm where they can basically say, "Continue with ackd alarms, but don't reset." When they choose this option, if new alarms are acknowledged later, they'll have another chance to add them to the 'known' count (reply to `totalAckd`), or reset equipment (reply to `unknownAckd`).

The enable/disable tag could even be configured based on the time of day.

Thoughts? Holes?
