13 Replies Latest reply on Sep 30, 2015 7:13 AM by sundown

    Sending Text Messages from Filemaker 11 to client phones

    sundown

      Title

      Sending Text Messages from Filemaker 11 to client phones

      Post

      I have been exploring several methods of sending a text message from FM 11.

      I think I am almost there. I am signed on a trial version of Text Magic that rents me a phone number for $4/month plus 20 cents/message. They sent me this Open URL example:

      Here is an example of an open URL:
      https://www.textmagic.com/app/api?username=USERNAME&password=PASSWORD&cmd=send&phone=99912345&text=TEXT&unicode=0 

      I use the FM script Open URL and use the previous URL. I inserted my user name, password and my phone number preceded by a 1, and the script works. However, when I try to merge the phone number Field from my data table,  the browser replies with "wrong phone number format".

      Any suggestions on how I merge the phone number field into this Open URL script?

        • 1. Re: Sending Text Messages from Filemaker 11 to client phones
          philmodjunk

          Did you know that you can use Post a New Answer to just keep posting to the same thread. That helps others know what has gone on before.

          To be able to maybe help you, we'd need to know two things:

          How is the data for your phone numbers stored in your database? What is the format?

          What does the exact calculation that you used with Open URL look like? (You can copy and paste it into your next response.)

          • 2. Re: Sending Text Messages from Filemaker 11 to client phones
            sundown

            Yes, I knew that but they were jumping around about different methods. This is a new method I am trying, so I thought it would be less confusing to start fresh.

            Good point on the phone format.I changed my phone field format, and it is now "numbers & "as entered". The attached image is my test script where I am trying to just send one text. The calculation for the Open URL as shone works with the phone number entered as a number. When I try to merge the Phone field in place of the number, it gives the "wrong phone number format".

            • 3. Re: Sending Text Messages from Filemaker 11 to client phones
              philmodjunk

              Sorry that I didn't state this more clearly, but I wanted to know how the data was actually entered into the field.

              all digits? Digits with () and - characters included?

              and is the field's data TYPE number or text? (Have to check manage | Database | fields to answer this Q)

              My guess is that you need to use a specific format, probably all digits and no other characters, always with area code and perhaps that leading 1 before this will work. Simply using a phone number without the area code will trip such an error after all.

              Your URL calculation, on the other hand is only sending out literal text. It is not including a phone number from your database.

              It should be something like:

              "Https://www.textmagic.com/app/api?username=USERNAME&password=PASSWORD&cmd=send&phone=" & Counseling::Phone & "&text=TEXT&unicode=0"

              • 4. Re: Sending Text Messages from Filemaker 11 to client phones
                sundown

                Yes, I understood you. The Phone field is numbers, and the format in the Data Table is numbers & as entered. The phone number is 10 numbers preceded by a 1 with no other characters, exactly like the unique number I showed in the example above. It works with the number, but will not work when I insert the phone field in the script. Below is the URL with the phone field inserted in place of the actual phone number. I also tried putting parentheses around the inserted phone field, but Filemaker rejected it.

                • 5. Re: Sending Text Messages from Filemaker 11 to client phones
                  philmodjunk

                  There is no such field data type as "numbers" and the "as entered" data formatting is a layout option that does not effect the actual data in the field. What is important is if the field's data type is Number or Text. But since your phone digits are strictly digits, the data type is not likely to matter in this case.

                  Your latest post does not match my suggested calculation. You have left out some quotes.

                  "Https://www.textmagic.com/app/api?username=USERNAME&password=PASSWORD&cmd=send&phone=" & Counseling::Phone & "&text=TEXT&unicode=0"

                  • 6. Re: Sending Text Messages from Filemaker 11 to client phones
                    sundown

                    That worked!! I saw your extra quotes, but the example they sent didn't have them & the fixed number worked, so I didn't use them the first time. Now I need to put in the loop for texting multiple clients and see if that works. I assume I use the same quotes like phone to merge in names in the text.This is great. Just what I needed.

                    Thank you VERY much Phil.

                    • 7. Re: Sending Text Messages from Filemaker 11 to client phones
                      philmodjunk

                      You assume correctly. The example they sent was what the data needs to look like when it reaches their site. When my suggested calculation evaluates, the value produced will be exactly like their example.

                      Using quotes and ampersand operators is how you do some "text surgery" to insert data into the URL string instead of just typing in a literal value. This is the same method used with Insert from URL to get data from a web site or with a web viewer to view data from a website such as sending GoogleMaps  an address and showing a map to that location in the web viewer.

                      • 8. Re: Sending Text Messages from Filemaker 11 to client phones
                        sundown

                        Hi Phil, I have hit another snag. I have the text message with field merges working great with one client record. I entered a second record & put the Open URL in a loop. I only get the text from the second record, not both. I was wondering how this script will handle the delays between multiple Open URL's. Do I need a feedback  from the URL or a delay between Open URLs? I am going to add a time delay between records to see if this is the problem, but thought you would already know the answer.

                        If the time delay between opening URLs is the problem, is there a way to only have one Open URL and loop the phone numbers? I could make a common message to all recipients if I could just send it to all phones.

                         

                        • 9. Re: Sending Text Messages from Filemaker 11 to client phones
                          philmodjunk

                          Don't know, but inserting a delay is what I would try next myself.

                          • 10. Re: Sending Text Messages from Filemaker 11 to client phones
                            sundown

                            It was my problem on setting up the loop. I didn't notice I was going to second record before I opened the URL. It now works great with multiple records. This service solves my text messages exactly like I was wanting since I will only be sending less than a hundred messages/month.

                            Thanks again Phil. I couldn't have done it without you.

                            • 11. Re: Sending Text Messages from Filemaker 11 to client phones
                              sundown

                              Hi Phil. About a year ago you helped me solve a filemaker indexing problem while sending out emails by performing a Recover procedure. Still working great.

                              Hoping you can help me with a new problem that is happening when sending out Text messages. You helped me get this set up in an earlier post http://forums.filemaker.com/posts/d389887b27

                               

                              Using the open URL script to Text Magic has been working, but occasionally the texts are send multiple times, sometimes a day or two later & sometimes a few hours later. This happens even though the "Send Text" script button is not clicked. An assistant sends the majority of these texts from the Remote site. The first couple of times this was happening, I had her restart her computer & the recurring text messages problem stopped. However it keeps coming back.

                              It seems like the open URL command is stuck or re-triggered on the remote computer some how. Is there a way to reset this URL on the computer that sends the Text in case it is staying open?

                              Or any other ideas on isolating or solving this problem?

                               

                              Text_Loop.png

                              • 12. Re: Sending Text Messages from Filemaker 11 to client phones
                                sundown

                                Another thought. Maybe this is the browser problem with the open URLs. When a set of Texts are sent out by multiple "Open URL" steps, they each open a new tab in the browser. Maybe the browser is set to open these tabs when it is opened?

                                Not sure of her browser yet, but leaving open URLs could explain why some Texts are sent again when the Filemaker script is not responsible.

                                • 13. Re: Sending Text Messages from Filemaker 11 to client phones
                                  sundown

                                  The open URL s in the browser tabs seems to be the cause of multiple texts. I have cautioned everyone to close all tabs after sending a batch of texts, but I would like better control of this.

                                  Is there a way to add a command to my script to "close" the URL after I have opened it?