2
REST PUT sends Numbers as Strings
planned
A
Antti Hannula
It seems that REST PUT sends numerical data defined in the Schema as "Number" as "String".
Log In
Activity
Newest
Oldest
H
Harri Sarsa
That's a known issue right now where you need to explicitly convert inputted values to numbers with the NUMBER formula, even with correct keypad type set. We will be bringing in a "Input value type: text/number" property in an upcoming release to remove ambiguity!
Kristian Gerkman
planned
Kristian Gerkman
under review
Kristian Gerkman
Hey @Antti Hannula, could you send a screenshot of the setup leading to this behaviour, most likely there is some conversion(i.e. the number being bound to an input field) happening before the PUT request is sent. I couldn't replicate so, any extra info is appreciated. Thank you!
A
Antti Hannula
@Kristian Gerkman: Hi Kristian. Thanks for reply. The input field is bound directly to a Data Variable field. The schema for that Data Variable defines that field as a Number. Should this be done some other way ie. not directly to this variable but via a Page Variable etc?
A
Antti Hannula
@Kristian Gerkman: In one case the Input primitive seems to have type "Text", that should be changed and might solve the problem? However, I did not find a way to define that. Can it be done? Thanks :-)
Kristian Gerkman
@Antti Hannula: Hmm, there has been some issues with the input field's value converting to be type of "text" instead of "number" and I'm assuming this also is caused by that, we are going to make 2 separate inputs for numbers and text in the near future so this issue will be obsolete then. The main issue here is that even tho the input's type is "text/number" it converts everything to be text..... it is not supposed to work like that, but there is an option for the input field to be "num-pad" type which is supposed to make the input number only, but once you bind the number variable to the input field, it converts it to be string.. so my solution to this would be that you set the input field to be num-pad aka only number inputs and then in the PUT request you use formula NUMBER() to make it actually number. Thanks!
A
Antti Hannula
@Kristian Gerkman: I tried numpad and decimal keyboard types. Unfortunately, they had no effect on my ipad app (it always displays normal keyboard). Also tested on iPhone, same problem and also sends numbers entered with numpad as strings.