draco66 Posted May 9, 2017 Share Posted May 9, 2017 I know this is going to be simple for someone out there. I have only used external data once. I have an external data file that contains order number, item ordered, and a point value for that item. In my Fusion template I have a data file that contains the order number, shipping address, etc. I need to go out to the external file and get all the point values for the items ordered for that same order number and add them up. This total point value will become part of the output file name of the PDF. Ex: 40_THK1376.pdf (the 40_ is the total point value of the order and the rest of the file name is the order number itself) Thank you for your help. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 9, 2017 Share Posted May 9, 2017 Something like this: var total = 0; var XDF = new ExternalDataFileEx("orders.txt"); var items = XDF.FindRecords("Order Number", Field("Order Number")); for (var i in items) total += Int(XDF.GetFieldValue(items[i], "Point Value")); FusionPro.Composition.OpenNewOutputFile(total + "_" + Field("Order Number") + "." + FusionPro.Composition.outputFormatExtension); Quote Link to comment Share on other sites More sharing options...
draco66 Posted May 10, 2017 Author Share Posted May 10, 2017 Worked perfectly. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.