Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted (edited)

Hi All -

Any help on this would be great. I am trying to batch import via script ISBN Book Information (using isbndb.com). Basically, the script pulls the ISBN and the Books Title from an excel sheet. It then goes to ISBNdb.com to get the remaining information (Author, Summary, etc.).

The problem is that the xml import from ISBNdb.com. The script selects the ISBN correctly from each subsequent record in filemaker, when the data is imported, it always re-writes the first record. I would use a match import, the database does not include a return of what you requested.

I believe the problem is with the style sheet - please see below, but any thoughts would be great.

Many thanks, Adam.










			0

			

			







































































						

						





							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						

						

							

								

							

						





Edited by Guest
Posted (edited)

I don't see an ISBN in the your stylesheet, so how could you be using import "matching"? This sentence of yours is not very clear:

I would use a match import, the database does not include a return of what you requested.

It's also a good idea to enclose posted code in code tags: ie, square bracket [, then the word "code", then a closing square bracket. Then at the end, [/, then code].I can't show it here, as will be get translated.

Edited by Guest
  • Newbies
Posted (edited)

Fenton -

Thanks for the Code tip. Below is the xml information that is generated by the webservice when you enter the ISBN. Ideally, I was planning to match the ISBN number, but it is not a stand alone item like "authors text." And as you pointed out it is not in the style sheet as I'm not sure how that would work.

As such, my guess is that there is something in the above style sheet that selects the first record as the destination of the import every time. I just can't figure out what, or what I need to add so that it too moves to the next record like the FM script.

Thanks for all of your help - Adam.


ISBNdb server_time="2007-03-18T16:59:45Z">

−

	

−

	

The Rescue



Nicholas Sparks

Warner Books



−

	

Taylor McAden is a volunteer fireman who is always the first to plunge into danger. But there is one risk he can't seem to take: falling in love. Then he meets Denise Holden, a single mother who has moved to the small town of Edenton, North Carolina, to build a new life. A near fatal car crash will bring these two together; but before that can happen, Taylor must first look into his past and see if it's not too late to take a chance on the future. "All of Sparks's trademark elements - love, loss, and small town life - are present in this terrific read." (Amazon.com)









−

	









































−

	

−

	

Amazon.com -- Literature & Fiction -- General -- Contemporary



−

	

Amazon.com -- Literature & Fiction -- General -- Literary



−

	

Amazon.com -- Literature & Fiction -- Authors, A-Z -- ( S ) -- Sparks, Nicholas





−

	

Sparks, Nicholas











Edited by Guest
Posted

First, thanks for putting your code in the code tags; much easier for anyone else to copy out to work with. You can indeed get the ISBN with the xsl, which you could then use as the match field in Import with the "matching records" option.

First, add an ISBN field to the Metadata section. Then, for the general book data, you would use:


  

    

  

Another area that needs some work is the Prices and the Subjects (also Authors). The Prices right now is just bringing a whole bunch of blank lines. It could bring in all of that data also. I don't know if that is your objective however.

Basically each of these multiple objects needs its own table in FileMaker; just like you'd do with any other FileMaker relational database. Just because its flat in xml doesn't mean it it's flat in FileMaker. XML is capable of presenting relational data in a flat hierarchical structure. Which is pretty amazing, and why it is the data transfer mechanism of the future (if not already).

Each of the above needs its own little xsl stylesheet. It would be fairly simple. Then its own XML Import. It could all be scripted; each is importing from the same xml file, just using a different xsl file; each importing into its own table, with its own fields. EACH is using xsl to get the ISBN, which would be the relational key to tie it all together.

  • Newbies
Posted (edited)

The good news is that the code worked. The bad news is that the ISBN entered via Bar Code is the 13-digit version and the web service provides the 10-digit to match to.

My initial thought is that I am back to the first problem of trying to determine why the script of style sheet goes to the subsequent record to copy the ISBN, but instead of remaining with that record goes back to the first record of the series to then import the information.

An XML and Filemaker book later, I still feel confused. Any thoughts would be great. Thanks for all of the help so far - Adam

Edited by Guest
Posted (edited)

The trouble is that this is hard to understand:

the script of style sheet goes to the subsequent record to copy the ISBN

It goes back and forth between using FileMaker words, "script", then the xsl stylesheet, then FileMaker "record," then "copy the ISBN". I cannot tell what is happening or why.

I have used Import matching with xml/xsl Import, and it works fine. But, if as you say, there is no key that matches exactly, then that will not work. In which case you'd have no option except to Import with New records. Which is not going to overwrite anything.

I just found this, at Brian Dunning's Custom Function site:

http://www.briandunning.com/cf/356

It can convert a 10-digit ISBN to a 13-digit one.

That wouldn't really help for the Import matching; unless you redid that calculation so that it worked in xsl; which may be possible, it's not recursive. Otherwise you could import into a temporary table, re-calculate the ISBN, then match up the data.

Or get your data from somewhere else that has a 13-digit ISBN. Amazon seems to use the 10-digit by default also though.

Edited by Guest
  • Newbies
Posted

Fenton -

Thanks this is great information. I finally determined that it was not the style sheet, but that I had not included "omit record" as part of the script.

The xml transfer now works great, but new script import problem has risen. The issue is that when the script goes to import the 4 fields from a copy of the open filemaker file, it has a clean import, but none of the fields populate. When I run it alone, it works fine but in the middle of script it nothing appears to import. I have also tried to search for the results of the script and then run the script, but the same thing happens. Conversely, if I manually import the records and then run the scipt it is fine.

Please see the below script code (my apologies as I am not sure what the best way to post this is).


import record - excel file (new record)

import record - filemaker pro database copy (match import)

loop

   import record - xml file (update current record / select fields)

   omit record

   exit loop if (ISBN < 1)

end loop

This topic is 6458 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.