Creating ISA and GSA segments
Hello all,
I have a flat file coming from my WMS that needs to be converted into an X12 E.D.I. file. The flat file doesn't contain the information needed for an ISA/GS segment so I'm attempting to build one. I know that much of the information can be hardcoded, but I wanted an outside opinion on whether I can use random number generation for the Interchange and Group Control numbers.
Would that work? Or is there a better way of creating these segments?
0
Comments
Jack Harris random numbers will typically work unless the destination you are sending this to does validation on what numbers have previously been sent. If you need to increment each time, you would need to store the counter somewhere else. Here is an example of using our state api to store a counter. See example "Create a value to track a sequence number for an EDI data import (that would be updated every time the import is run)".
How would I call that within the flow though?
How would you make a random number handlebar? When I try the following I get letters:
Expression:
Result:
Jack Harris for now, the "number" option in the random handlebar expression is only available for NetSuite exports/imports. Here is another way to come up with the same thing:
Jack Harris if you need to use the state api, here is an example of how I would use it via a preMap script. Notice that the output is the same data coming in, but it adds a new cache object. Within that, it has the stored control numbers for you to reference in your file definitions. Each time this runs, it will grab the stored control numbers and then increment the stored control values by 1. It's a bit complex, but should do the trick for you.
Kit Hunter I think you asked about the same thing on office hours today. You could utilize the above.
Tyler Lamparter feel free to delete this comment due to clutter, but I did want to make sure to thank you profusely for this. Script looks amazing!
Tyler Lamparter - Could this be modified to start recounting per flow run. For example, if I have one flow run then it appropriately increment for that flow run, but if a new flow is kicked off it would reset?
Dave Guderian yes see comment here: https://docs.celigo.com/hc/en-us/community/posts/30509044478875/comments/30646085691675
Please sign in to leave a comment.