Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Nahla_Mabrouk
Contributor
Contributor

Cast field types in JSON - REST connection

i have a rest connection that is getting json response from air table

one of the fields is a text that might have value like 2.10 but when i get the data from the JSON it's converted to numbers which results in 2.1 i tried to convert it using TEXT function in the load but zeros are removed in the result from the JSON

i tried converting it using TEXT function and also with number format like: text(Num#(ID, '0.00'))

i need to cast it in the SQL query when fetching the data but I'm unable to do this

Labels (3)
1 Solution

Accepted Solutions
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Nahla_Mabrouk 

Do it with a preceding load - This should solve your problem.

RestConnectorMasterTable:
Load
*,
Text(id) as idText;
SQL SELECT
"id",
"login",
"first_name",
"last_name",
"email",
"restrict_email",
"user_type" as "user_type",
"timezone",
"language",
"status",
"deactivation_date",
"level",
"points",
"created_on",
"last_updated",
"last_updated_timestamp",
"avatar",
"bio",
"login_key",
"custom_field_1"
FROM JSON (wrap on) "root";

 

Regards - Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn

View solution in original post

1 Reply
JandreKillianRIC
Partner Ambassador
Partner Ambassador

Hi @Nahla_Mabrouk 

Do it with a preceding load - This should solve your problem.

RestConnectorMasterTable:
Load
*,
Text(id) as idText;
SQL SELECT
"id",
"login",
"first_name",
"last_name",
"email",
"restrict_email",
"user_type" as "user_type",
"timezone",
"language",
"status",
"deactivation_date",
"level",
"points",
"created_on",
"last_updated",
"last_updated_timestamp",
"avatar",
"bio",
"login_key",
"custom_field_1"
FROM JSON (wrap on) "root";

 

Regards - Jandre

Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn