logo

NJP

#Part 7 Load data for all countries and run the Transform Map

Import · Jun 02, 2020 · video

okay so in this video what we are going to do we are going to retrieve the result for all countries and inserted into our target tip okay so so far what we have done we have our data source we have our script which is actually going to get the result for one country specifically here India it's going to call the flow desire action get the output and we're gonna run a loop on the out on the country summary array to get the values we store it in in particular variables and then we are creating a map object which will be useful for us in order to insert all the data into our staging table okay it's the entire script this is what is doing this entire script so now how we can have the same thing for all countries quite simple we have to loop the entire script okay we have to repeat for all countries so we have India may have to do for all other countries in the same way so for that what I'm going to do is to create an Ares as we have an area for for example a country summary area which has the response and where we are looping to get the result for each day we're gonna have similarly another area which is going to be country's array where we we will have all the countries okay so that that variable we will have it in the top of the script and then we are creating we are creating a loop which is actually going to loop the entire script and then it will change the value of the input okay it will have the first country the second country to country for country and then it will go on till the end of the array okay so let's do that so here I'm going to basically create a an array so it's going to be bar countries array so I have it here in my file here all the countries I'm gonna just copy face that one directly into the code okay so we have here all our countries and it's in the country's very and at this point what we need is to create a for loop a for loop which is going to repeat the code that we have the entire code that we have below and we're gonna repeat the code okay so I'm creating here var a equal to zero a inferior to countries dot length so it's going to look for the entire length that we have for the country story and then a plus plus okay for each iteration we are going to change the value the way we change the value basically we're gonna replace here for example India by countries okay so let me just finish here the loop so I close the loop and then we are going to just delete India and then we are going to put countries and then a okay it's all we need to do and that's it so this is our code and we can test this code to see it's going to work or not so we can directly click on load all because to see what's going to happen so it's going to run the loop for each country's are we gonna yeah it is going to insert records for each countries one by one okay there is a for each country's it is calling the flow designer action it is not putting the data in a bulk that's the advantage here so if you do that in flow designer if you are creating you look there it's going to fail and if repeat multiple requests also info flow designers going after the best option is to have the code created right here in our data source so it's still running so we have a big amount of data here so or I guess here it's around 13,000 records you can see there so we have a successful import set now we can run the transform app and load the data that we have in our staging table directly to our Cobie 19 km okay to our target table so let's click on transform and you can see here we have our input set and make sure that you have the right transform app on the right side it is you have the one you'll get East Oracle data import transform app and click on transform so it's going it is going to take a little bit some time here and this is like the moment of truth which is going to work or not okay so we have a successful message here we have inserted all the data into our target table here so we can check by clicking on table code in 19 cases [Music] so click on show list here we go we have all the data in our table and you can notice as well that we have the same date that we have in the date field credit field and updated field these are the past date thanks for watching bye

View original source

https://www.youtube.com/watch?v=w1qrEtLX5-M