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