AnsweredAssumed Answered

Best practice for importing data with complex business logic?

Question asked by swiftroot on Aug 21, 2018
Latest reply on Aug 21, 2018 by swiftroot

I've been tasked to write a FM import for an older database (Though its FM version is 16 which I'll upgrade to 17). It needs to import data from 2 sources (One a CSV, the other a REST API) on a schedule.


The import needs to not only insert/update information, but run logic on certain conditions. IE., if its a new user, but their address matches another user, add some additional information and set various flags for the record. This also varies depending on which import source its coming from.


My thinking is that, the regular CSV import won't cut it, and I'll spend too much time fiddling with the FM script to get what I need. (This is my assumption based on my lack of expirience in this area).


So, because I already have to connect to a third party API, my solution is to do it all inside of NodeJS (Installing CURL and hacking API calls in FM seems strange to me). Specifically, I was planning on creating a NodeJS application and using the FM Data API to import/update records.


-> Pull data on schedule (from 3rd party API / CSV dump)

-> Process each record (See if record exists in FM, run business logic on data)

-> Insert/update inside of FM

-> Give user a report on the results


I'm a long term developer but new to the FM side of things.

- Is the above a solid way to approach this or am I over-engineering?

- Is Data API the right approach, or is there something better?


Thank you,