I am trying to use Talend Data Integration in order to take an Excel spreadsheet's rows and use the emails listed in the spreadsheet in order to get a list of addresses for the tSendMail component to use.
So far, I have: tFileInputExcel -> tFlowToIterate -> tSendMail.
I have already looked at these two threads but have had no luck in understanding where I should go from where I am currently.
You seem to be on the right track.
As you gathered, you need to trigger the tSendMail component iteratively.
Talend's normal row connectors between components passes a flow of data from one component to the next. If you use an iterate link then instead it will send just the first row for processing to the rest of the subjob.
Here you basically have a list of email addresses in an Excel file so you want to iterate through the list, passing them to the tSendMail component.
If you connect a tFlowToIterate component to your tFileInputExcel component then the tFlowToIterate will effectively just trigger the tSendMail component once for each row of data in the input file. It doesn't actually pass any data directly.
Instead, the tFlowToIterate moves the data into the globalMap where it can be read from by any downstream components. To use the data you would access it with something like ((String)globalMap.get("row1.email")). If you press ctrl+space on, for example, the "To" field in the tSendMail component Talend should show a list of available variables:
Here you can see some metadata about the tFlowToIterate_1 component but also the "email" column that is the sole column of the Excel file's schema. If we select this then it will automatically give us the globalMap.get for the component (which in my case is the aforementioned ((String)globalMap.get("row1.email")) because I left the checkbox of the tFlowToIterate as default).
Then it's just a matter of properly configuring your tSendMail component and using the value from the globalMap as your "To" property:
Using this same idea we can do more complicated things too. For example we might have a custom message body in the Excel file and also the name of the recipient (which could also have potentially have been parsed from the email address prior to the tFlowToIterate) so we can then do something like:
Related
I am a beginner on Talend, I have a problem processing a json file via talend. I have a json file with several levels and containing tables on different levels (or depths) of json. I just want to add an attribute in a json area located at a given depth via thmap. So in input I have the json file and in output the same json file with the new attribute. I have no idea how to configure the thmap although it is dedicated to simplify complex mappings.
difficult to answer without more information can you create a screen grab of your TMAP usually it's quite simple in the output field to on the left cell you add it there
Could I know does it have any method to load multiple files that are multi schema delimited files which store in same directories in Talend?
I have tried use the tFileInputMSDelimited component before, but unable to link with tFilelist component to loop through the files inside the directory.
Does anyone have idea how to solve this problem?
To make clearer, each file only contain one batch line but contain multiple header line and it comes with a bunch of transaction line. As showing at the sample data below.
The component tFileOutputMSDelimited should suit your needs.
You will need multiple flows going into it.
You can either keep the files and read them or use tHashInput/tHashOutput to get the data directly.
Then you direct all the flows to the tFileOutputMSDelimited (example with tFixedFlowInput, adapt with your flows) :
In it, you can configure which flow is the parent flow containing your ID.
Then you can add the children flows and define the parent and the ID to recognize the rows in the parent flow :
I need to send an email using Talend however using I need to have the address captured from a csv file. (automated each time and not specified manually)
Right now I can only add an email address manually. I need Talend to capture it from the csv file and also I need it to send once and not many times (right now as long as the query is running it send many emails)
I am not sure if this is what you are after but this is my suggestion:
The tSetGlobalVar component simply initializes the variables like this:
Then the tMap supplies the t_Java_Row with the e-mail from the file (I am assuming that is where it is - you didn't specify). The code in the tMap sets the values of the global variables with this code (in the code section of the tJava_Row component)
globalMap.put("email", input_row.email);
globalMap.put("body", input_row.body);
Then in the send mail component you recall the variables that were set.
Hope there is enough in there to help a bit. There might be other ways to do this, but that would be my approach.
Cheers.
I have a problem with oracle apex forms.
The problem is that I want to add more than 1 record at the same time in 1 form. I have already read that the best way to do that is to use an csv file but then there is no tutorial to do that.
Oracle is a database, and combining files with databases is always tricky and not extensively supported for obvious reasons. Storing files and presenting them for download is one thing. Getting an Oracle database to open a file and reading and processing the contents is another. It sure it possible, but especially combining this with an Apex application I think you are going to run into a lot of challenges such as security restrictions.
However, stepping away from files does not necessarily mean stepping away from CSV. You could simply offer a large text input on your page in which a user can copy-paste a large CSV string. This can then be submitted and processed by the database. To do this you would probably need to create a process that gets fired after you submit the page. From this process you can parse the CSV data and insert multiple rows in a table. The same can be done for things like XML or JSON.
However, who is generating this CSV? Requiring a user to construct CSV is not very user-friendly. It can be complicated and error prone. If the CSV is generated by another application, isn't there a way to circumvent Apex and pass the CSV to the database directly?
If a single text-based data carrier is not required, which I doubt reading your descriptions, why not simply keep your form but allow the user to submit multiple forms? Would if be sufficient to insert one record per submit, and later using a batch to query these records and start formatting one at a time?
If you simply want the user to be able to enter multiple machines without having to submit the page for each machine, this is also possible, but you will have to leave some standard Apex functionality behind and implement some more custom javascript and PL/SQL functionality. Apex only allows a static amount of page items, which needs to be defined design time. So if you want to dynamically add fields such as text boxes and select lists to your page, you will have to resort to javascript. You could start by defining a region which renders one row of input fields at page load, and create a link under it saying 'add another row', which will render a new row of input fields under the existing one, and repeat this as many times as the user needs to.
That takes care of the UI. Now when the user has entered all the data he wants, we need to submit all this data and get it into the database. So yes, at this point we would probably have to get all this data from the input fields and turn it into one single string. This would all have to be done client side in your javascript code. You can then use the Apex page item API to assign this generated string to a single page item, using the $x(...) or $v(...) functions. Then submit the page, at which point the page processes will be fired. You then define a page process which will parse the data in your page item, and use that data to insert multiple rows in the database.
I have a nice process overview for our ordering process in Visio. I have an external data source (SQL Server), which works fine. Every record in my data source represents one ordering process. Currently all my shapes of the process are linked to the first record of the data source.
Now I want to add a dynamic behavior. What I want to achieve is this:
A user provides the order reference in a textbox (order reference is a column in the data source)
Afterwards the user clicks a button
After the button click, the process is updated and all shapes are now linked to the external data source record, that matches the provided order reference
So in short: the user should be able to select which process that needs to be visualized.
I assume that this is common functionality, but I don't see how I can deal with this requirement. I've searched already some days on this issue, but without any success.
Can you help me with this issue?
Thanks a lot!
Problem solved :-)
Some old school VBA was required. Using the DataRecordSet object did the trick. It contains a method GetDataRowIDs that you can use to query the external dataset. Once you have the record to visualize, it's just a matter of dynamically updating the shapes with the correct record. Use macro recording to see how to do this.
MSDN: http://msdn.microsoft.com/en-us/library/office/ms195694(v=office.12).aspx