cancel
Showing results for 
Search instead for 
Did you mean: 

How to add data type

Pretty
New Contributor III

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.

9 REPLIES 9

darshthakkar
Valued Contributor

Hi @Pretty,

You can use “type converter” snap to add/modify data type, let me know how it goes.

Pretty
New Contributor III

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?

ljupcho_machko1
New Contributor III

@Pretty , in the given sample data all the values are type String. You can use Type Inspector snap for this.

koryknick
Employee
Employee

@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.