Forum Discussion
If the Header Fields property in the snap is not set, the headers will be pulled from the incoming document. Also, the Snaps try to preserve the order of the fields in the document. So, it’s possible things will “just work” right now for you.
If you do need to change the order of the fields in the document, you should be able to do it in the mapper using the expression language. You’ll need to get the list of fields, sort it by the key, and then reconstruct the object.
You can get the list of fields in the document using the entries()
method and then sort()
that list. The sorted list of key/value pairs can then be fed into the extend()
method to produce a new object. The following expression does that and does a reverse alphabetical sort:
{}.extend($.entries().sort((left, right) => -left[0].localeCompare(right[0])))
I’m attaching a pipeline that demonstrates both scenarios, using the natural order of the fields in the doc and doing the above sort:
CSVColumnOrder_2018_05_10.slp (11.8 KB)
Thank you so much! This example pipeline was extremely helpful.
I am also facing same issue . Any update ? Have you solved it ?
Yes, we did solve it. The problem was that API Gateway resides in the public VPC portion of our AWS account, but the SnapLogic call was happening over our private direct connect tunnel into our local environment. We were able to solve the problem by enabling the endpoints as VPC link resources, and setting up a network load balancer that points to the internal SnapLogic URL.
Related Content
- 2 years ago
- 4 years ago
- 3 years ago
- 2 years ago