Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Scripting External Lookups - Newb says thank you

Featured Replies

  • Newbies

I have created a custom web viewer that pulls an xml file that I need to extract information from.

I need help making the script that pulls the numbers that are from 6-7 numbers in length and they appear in the xml as follows

"[color:red]503998< /amount>

These numbers change with each file, and I need to set the portion in [color:red]red to a field.

I added the space to the amount tag.

Any help is appreciated I just cannot figure out how to refer to these numbers in the scriptmaker.

Edited by Guest

Why not import the XML file?

http://www.filemaker.com/help/12-Import%20export15.html

  • Author
  • Newbies

I am getting an XML parsing error, also I really dont think this will work because it seems like the XML import is something done to import multiple records.

In my case I need to run a separate http request for each record and extract the unique number that I show in my above post. Thanks for the help but I am really trying to find a way to automate this external lookup for each record, maybe on an original import if I could run a script that loaded it for all my records, that would be great. Any ideas?

You can import any number of records - including one. Of course, you will need a XSLT style sheet in order to import into Filemaker. I am guessing that's why you got the parsing error.

Alternatively, if there's only one occurrence of amount in dollars in the text, you can extract it by:


Let ( [

prefix = "" ;

pos =  Position ( text ; prefix ; 1 ; 1 ) ;

start = pos + Length ( prefix ) ;

end = Position ( text ; "<" ; start ; 1 ) 

] ;

Case ( pos ; Middle ( text ; start ; end - start ) )

)

We could likely help better with the XSL stylesheet if we saw the http request, if it is available to the general public. Or the xml file returned (attached to a post, not pasted into one, as the makes a mess of it).

I really don't see why the discrepancy between what you request and what you get (record vs. records), or why it's a problem. You can use Import, with the "Matching records" option, to line up imported data to the correct record. Or you can specify particular pieces of data in the xml for a record. There are several examples here in the fmforums xml forum of successful imports; though every one is slightly different.

Or you can do as comment suggested in his last post, just parse the data out.

Edited by Guest

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.