08-17-2022 05:24 AM
We have Json file as input source which some random data for that values we need to add datatypes.
Sample data:
{
“Id”: “1076”,
“jobTitle”: “Software engineer”,
“firstName”: “David”,
“lastName”: “villey”,
“fullName”: “Davidvilley”,
“email_N”: “Davidvilley@gmail.com”,
“telephoneNumber”: “+1-8474987109”
}
Please help me to add the datatypes for above data to validate.
08-17-2022 06:00 AM
Hi @Pretty,
You can use “type converter” snap to add/modify data type, let me know how it goes.
08-17-2022 06:43 AM
hello @darshthakkar @ljupcho_machkovski
Thanks for your quick response.
Type converter and type inspector snaps are not available in our snaplogic so is there any alternative method or snaps to achieve this?
08-17-2022 06:30 AM
@Pretty , in the given sample data all the values are type String. You can use Type Inspector snap for this.
08-17-2022 06:48 AM
@Pretty - I think we need a bit more description of what you’re trying to do here. If you just want to convert $Id to a number, you can use the built-in expression language function parseInt($Id) in a Mapper snap.
As @ljupcho_machkovski pointed out, everything else is a String. JSON only supports a small number of data types: String, Number, Object, Array, or Boolean.