Insert into Web APi with JSON after data transformation

More
6 months 2 weeks ago - 6 months 2 weeks ago #25964 by prashant

I would also like to understand how the JSON option in the "Writer" works.  

I had originally thought that I could use the Writer, Paste in my full JSON on the JSON tab and those target fields would be available to map to in the Transformer.  

But this would do one giant insert of all rows at once to an endpoint?  But there is nowhere to define the endpoint, so I am very confused.   But this would not work because it would open so many concurrent sessions.

This is why I thought I would write individual JSON's to disk and then loop through those.  

Just trying to think this through as the video posted was very helpful, but looks like it will be very time consuming to build out as I will need a JSON variable node for each value. 

Thanks again and sorry for all the information, just trying to better understand the process. 




 
If I may ask ,
1. what exactly is the end goal , you want to build the JSON to do what ? You wish to send it different endpoints for each customers ? If yes , where is this information? in CSV itself , AETL allows you to customise the endpoint also for each type of customer or unique id you have. 
2. You can always ask chatgpt to make you a python script which can convert your csv headers into json file very quickly.,if mapping is painful. Team AETL and I had come up with a prompt which works very well . It's at the bottom of the page here  www.etl-tools.com/wiki/knowledgebase/tips/working-with-python/
3. If you dont' like script , and all you care is simply having a csv , converting it to JSON ONLY , check video below
4. WHEN YOU LOOP and define an endpoint , it sends all the data to end point 1 by 1, in HTTP ACTION there is an option to define the end point OR you can your use AETL end of loop action to do it  also. 

For 3 , I have created a video you can look at 
www.loom.com/share/6bd9e56e187b44879ef7b538e5b0e552
Last edit: 6 months 2 weeks ago by prashant.

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #25965 by prashant

It will create a giant JSON file, since you want multiple files it will not work for you.

 
Why won't this work ?

{GetVariable('#file-name#')}.JSON ? 


EDIT
I can confirm it works using this methodology 
www.loom.com/share/6bd9e56e187b44879ef7b538e5b0e552
Last edit: 6 months 2 weeks ago by prashant.

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #25966 by Peter.Jonson
Thank you Prashant for the video.

JSON writer create a very basic JSON.
We do not know exact JSON spec for API end point and most likely JSON writer is not flexible enough.
Likely there are better alternatives available

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #25967 by Peter.Jonson
Hi Tim.

Please find attached a working example as promised

It does use in place replace transformation function which is much easier option for complex JSON files 

www.etl-tools.com/wiki/advanced-etl-proc...ngs/inplace-replace/

File Attachment:

File Name: Demo.zip
File Size:6 KB

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
6 months 2 weeks ago #25968 by Peter.Jonson
Here are some screenshots as well








Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save