How to change Entity attribute Datatype from string to Float/Integer/Decimal?

0
We are accessing data from Rest API in Mendix. Data is in string format and we want to change its datatype for further graphical implementations. Please find below snapshot while trying to convert string datatype to Integer using Microflow.     While assigning one attribute data to other which is of different type giving below error. I have also tried manual conversion but getting runtime error during conversion. Can you please guide how to parse datatype I am facing above runtime error while parsing Please suggest        Hello All, Even if value is present in attribute I am not able to parse the string value to Integ
asked
3 answers
2

You could handle it in the microflow that handles the REST call and parse the string value into a decimal value by using parseDecimal() action. But I would recommend to make sure the string always contains the correctly formatted format or to build a propper handling for the case when it is not possible to parse it correct. Also, you can take a look for fruther details here on the Mendix doc : https://docs.mendix.com/refguide/string-function-calls

answered
2

If you are using an import mapping based on a json structure, it should be possible to just remove the quotation marks in your json structure. Thy system will now interprete the string as decimal. You only need to make sure that you really only get decimals. Otherwise, importing will fail.

answered
0

Hello Snehal,

 

Try Import mapping/export mapping to get/post the data. It will pass your data in JSON format and you can pass the value in desire datatype.

you can take a look for fruther details here on the Mendix doc : https://docs.mendix.com/refguide/call-rest-action

Hope this will help you

answered