Issues setting data types in data mapper

I have two fields being passed to me. One is a date and the other currency. I am trying to set the data types in the data model and I get the message that the fields are unparseable when I try to set them to date and currency. I should mention that I am also setting the language to German. These are the two fields and the intended format:

38655.460000 format: 38.655,46

2016-10-12T00:00:00 format: 12/Okt/2016

It is interesting to note that the currency field will work if I set it to a data type of float but the thousands separator does not appear.

Can someone help with this?

Those field being passed, you mean that they are part of the data, right?

They are the actual tags from the XML data source.

Many variable might be taken in account in solving your issue. I would recommend opening an online issue so you can send us your Connect template and data in which the error occur.

Click on the following link http://planetpress.objectiflune.com/en/resources/support, go to the bottom of the page an click on the Report an issue online.

Then we will be more than happy to help you.

If you do not have OL Care, then repost here and we still try to help you through OL Learn.

JC

This is an eval version that I am running. So I guess I cannot open an issue online.

I did resolve the currency one. I was setting a currency symbol and there is not one in teh source data.

However, the date format is still giving me an issue. How would you like me to proceed?

Well, I still went ahead while waiting from you…

In the Data format pane at the bottom of the Step properties pane, you have a Date/Time Format field, by default it is set to yyyy-mm-dd hh:nn ap. Remove the trailing so it goes back to yyyy-mm-dd.

Remember that the formats your setting mentioned in the previous paragraph are to tell the Datamapper how to read the value from the data.

Then in your template, using scripts, you can change the format of the data as you see fit. If you look on the internet you will find many function that will allow you to reformat your values.

Hope that helps.

(sorry, I just realized after posting that there were already answers coming in, but I’m leaving the post as is since it contains explanations for both data formats)

When setting a data type to Date or to Currency, you have to provide additional information about the input format (that’s NOT the ouptut format). In other words, you must tell the DataMapper how to interpret what it reads in order to convert it to a Date or to a Currency format. You provide this information through the Data Format section in the Step properties panel, right underneath the dropdown list for the Type.

For the Currency, make sure you specify the period (.) as your decimal separator and remove any currency sign and thousands separator, since your data doesn’t include any.,

For the Date, make sure the format is set to yyyy-mm-ddThh:mm:ss which is the standard ISO format used in the input file. More information about that ISO format can be found on this Microsoft page.

And for your information, when you are running an evaluation version of PlanetPress Connect, you are entitled to 30 days of support. So you are not simply evaluating the software, you evaluate us too! :wink:

Thanks everyone for the quick responses!

This is my first attempt at javascript. Where would I use the script? In teh designer of teh data mapper?

The formatting of the data itself (i.e. how you want it to be displayed), is handled through teh Designer, in theTemplate.

I guess I will have to take another look at the tutorials. Like I said, javascript is new to me.

I did find this library online that seems to simplify it called moment.js are you familiar with it?

In the designer,

Place your field where you want it on the page. It will look something like @fieldName@. You will see that on the left of your screen there is a Scripts pane and under it you newly added field that shows fieldName | @fieldName@. When you select that pair, the actual field on the screen is highlighted in green.

If you double-click, an Edit Script dialog box open which shows you your field and the format selected. You will see at the bottom of that dialog box a button that says Expand.

There you have the script that actually show and format your field. This is where you will put your javascript to change the format of your field accordingly to your need.

Once that is done, when you’ve gone back to the designer main screen, select the Preview tab at the bottom of the page to actually see your field being replace by the value you want.

Hope that help!

I guess I will have to take another look at the tutorials. Like I said, javascript is new to me.

I did find this library online that seems to simplify it called moment.js are you familiar with it? How would I use/install an additional javascript library or function for use in designer?

Very easy…simply drag and drop the file containing your javascript onto the JavaScripts folder which is found under the Resources pane of your designer. Make the file as the extension.js.

Hope that helps.