Skip to main content
Known Participant
Apr 13, 2022 12:04 PM UTC
Question

How to store data in Appian Cloud Database in absolute decimal form?

I want to save the value for Ownership % field (last column) in the below image, as absolute values, i.e (Number/100)

E.g. If a user inputs 46.00 in the Interface Dashboard, the database would store it as 0.4600

If there any workaround to achieve this?

5 replies

stefanhelzle0001
Brainy
Apr 13, 2022 12:11 PM UTC

Can you give us a few more details? How does the interface look like? Screenshot showing the entered value? There is just too much going on between the user entering the value and the screenshot of the database.

Known Participant
Apr 18, 2022 12:12 PM UTC

[mention:126a676c85024855948336691b0a7b92:e9ed411860ed4f2ba0265705b8793d05]

Please find attached the screenshot of the interface. 

stefanhelzle0001
Brainy
Apr 18, 2022 12:29 PM UTC

OK. I need to see the value in the field, the rule input and the process variable.

New Participant
Apr 13, 2022 12:48 PM UTC

There are two things when you consider a decimal field in a DDL script used to generate tables like below test table.

CREATE TABLE `Test` (
  `id` int(11) NOT NULL,
  `ownership` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
The 10 indicates the precision which is the maximum allowed integer and decimal digits.The 2 indicates the scale which is 2 decimal places.
If you want to have only 2 decimal places then update your table with DECIMAL(10,2) like above.
Inspiring
Apr 18, 2022 1:56 PM UTC

Hi,

As Balachandran mentioned use decimal field in your CDT and data base to store decimal values. In case if user is entering the values in numbers (ex: 40, 50 65 etc..) save this value in one local variable first and then convert that value to percentage and save back to your CDT.