Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6729 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm looking to capture double quotes within a calculation for the purposes of producing a desired url

For example trying to capture:

http://www.xyz.com"abc"

How would you script this?

I can get to "http://www.xyz" but then I can't figure out how to capture the double quotes because they are inherent operators.

I would think it would look like: "http://www.xyz.com"&""" but that doesn't work and for obvious reasons. Is there a substitue symbol I should be using?

Forgive me - I'm not a programmer

Posted

Although I have now idea why you would want to put a quote behind a email address,

Try

http://www.xyz.com"abc"

HTH

Lee

Posted

Hi Lee and thank you. I'll try this tomorrow. Since you asked, I'll be more specific about my application.

I manage a sales team at an ISP. We sell the Internet component but often times this requires a 3rd party loop to get between our location and the end user's address. Therefore, I've put together a database of vendors addresses for my team's reference that allows them to submit quote requests to these various 3rd parties based on their addresses in relation to our network.

In doing so, I'm also using the USPS's address standardization dbase which is available via XML and various APIs. I downloaded their API and entered it into my browser to test it. It worked fine.

Here's the catch. Their required request (sent to them via a url) uses double quotes in the formula.

Therefore, when I was building the XML query, I couldn't figure out how to use Filemaker's syntax in the url calculation field to encapsulate the double quotes because double quotes are considered a parameter.

I believe your suggestion will work. Will try when I get into work tomorrow.

Thanks again,

Rick

Posted

In looking at this again, let me start by saying that the "" is telling FileMaker to treat this operator as a Text character, instead of an operator. If you were to do a search of the forum, for quotes, and calculations, etc., you would see that since version 7 was released, it has made it easier to deal with quotes and other operators.

In looking at the earlier posts, it isn't really clear to me what your real circumstances are, and how this needs to be applied.

So, I don't think that the previous post will work, and this is modified version that I also don't think will do it.

http://www.xyz.com """abc"""

I think this is what you are wanting,

"http://www.xyz.com" & """& "abc" & """

However, if you are Concatenating two fields, then here is is another way that may be easier.

Lets say you have Two existing Fields, and I'll call them [color:blue]URL and [color:blue]TAG for this demonstration.

[color:blue]URL = text field (has your data www.xyz.com)

[color:blue]TAG = text field (has your data abc)

New Field (Calculation, Text Result ) =

[color:blue]URL & """ & [color:blue]TAG & """

or shorten it to:

[color:blue]URL & Quote ( [color:blue]TAG )

Let me know if this doesn't help, and what where it breaks down.

Lee

Posted

Lee - thanks again

We're getting closer but not quite there.

Here's a better way of asking the question:

Can the following be produced in a url from a calculation?

http://"

(if it can, I can figure out how to reproduce elsewhere in the calculation)

NOTE:

"http://" & """ & """

returns

""

now if I can only get the language down to return a single "

Posted

hmm.... still nothing

Here is the actual url I am trying to produce from a calculation. Instead of using actual field references, I'll hard code it with a dummy address of:

6406 Ivy Lane

Greenbelt

MD

http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

6406 Ivy LaneGreenbeltMD

If you copy/paste this into a url, it will actually resolve (work). Therefore, question becomes how do you build a formula that will reproduce this. I would obviously be substituting the actual dummy data above with actual fields from my dbase.

The return data will yield:

<?xml version="1.0" ?>

-

-

6406 IVY LN

GREENBELT

MD

20770

1440

Posted

For some reason that url didn't copy/paste properly into this thread - perhaps too long - trying again

http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

6406 Ivy LaneGreenbeltMD
Posted

I am getting mighty confused here. Are you trying to produce a URL or create a XML document? Where is the result supposed to reside, and how do you plan on using it?

Inside Filemaker, a URL is nothing but a text string. I thought you asked for a calculation that returns this string:

http://"

Each one of the first three formulas above returns exactly that. The rest is a mystery to me.

Posted

My apologies

URL

The URL posts to the USPS site and returns a response (they are running an API) - I am delivering the data to that API via a URL they provided.

Because their URL request has double quotes in it, I needed to figure out how to repeat them in my formula.

I am using Filemaker Advanced 5.5

Created a button

[open URL, no dialogue;]

specify calculation:

ENTER code here necessary to output the following:

http://

testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

6406 Ivy LaneGreenbeltMD
Posted

I'm confused as to what you are really are needing.

Clarify version to be 5.5? as it makes a big difference in what you need for the quotes.

Lee

Posted

okay.

Next, the URL is usually a text field, not a calculation.

Post a sample of where you are going in the USPS site.

To keep it in tack, use the Globe Icon (URL Link) in the Reply so I can actually go to their site where you are talking.

Lee

Posted

Assuming you have the required data stored in fields with matching names, i.e.

UserID

Password

AddressID

Address1

Address2

City

etc...

your URL calculation needs to be along these lines:


"http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

& Quote ( UserID )

& "%20PASSWORD="

& Quote ( Password )

& ">
"
& Address1 & "" & Address2 & "" & City & "" etc. ...

Posted

Thanks Lee - I'll give this a shot when I return to work. The reason the url is a calculation is because of the nature of this request.

My dbases is loaded with customer provided addresses. Many times those addresses are provided to us incorrectly.

This calculation will pull the address, city, and state from each individual address within my dbase (when prompted) and push it to the USPS site where it will be run through their API. That data is pushed to them via http through a url with the data being requested.

Since each record is unique, a calculation must be performed to pull the data independently so that validation on the USPS site can be made and returned. The information returned is the correct spelling, punctuation, grammar and it adds the zip+4 data as well.

I can then webscrape that data back into my dbase if I wish or simply display it in a separate web viewer window.

I'll keep you posted on my progress. I very much appreciate you generosity in helping me through this process.

Posted

I think comment is on top of this better than me, but I will join in and help when I can.

Lee

Posted (edited)

I think I'm going to give up.

The 4 methods that Lee provided for reproducing double quotes withing a calculation just don't work on any sample calculation that I tried. Filemaker won't accept the language for me.

Here is a screen shot of what Common suggested along with the error code I'm receiving which states "The specified table can not be found" - referencing the highlighted portion of my user code below


"http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

& Quote (702[color:yellow][b][i]COGEN5515[/i][/b][/color])

& "%20PASSWORD="

& Quote ()

& ">
"
& Address1 & "" & Loop Quotes::Address 1 & " & "" & Loop Quotes::City & "" & "" & Loop Quotes::State & "" &Loop Quotes::Zip & &"" & & "

Edited by Guest
added code markup
Posted (edited)

Wow - 99.999% of the way there

Would you believe, everything is working properly execept 1 thing - the URL calculation isn't picking up the last character for some reason

Here is the the formula that "almost" works:


"http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=

& """ & "702COGEN5515" & """

& "%20PASSWORD="

& """ & """

& ">
& ">" & Loop Quotes::Address 1 & "" & Loop Quotes::City & "" & Loop Quotes::State & "" & Loop Quotes::Zip & "" & "
" & "" Here is URL that works for testing purposes (what I'm trying to get the calculation to output). You just need to add http to the front of this. I'm leaving it off so that this doesn't get truncated in my post. ://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=
164 South Park St San Francisco CA
and here is the url its producing (note: only the last characeter is missing and that character is ">" ). Again, I dropped the "http" from the begginning of the url so that it would post correctly in the forum. :/testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=
164%20South%20Park%20StSan%20FranciscoCA94107

Any ideas why this last character ">" won't show up??

Edited by Guest
added code markup

This topic is 6729 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.