0

I'm trying to get data from accounting software per Api by PoweAutomate desktop. I get Json object and convert it to custom object. enter image description here Then I assign every atribute to a variable for adding it in sql table. But I have a problem. This number is read with comma and I have further problem to add it as decimal(18,2) to SQL table Error converting data type varchar to numeric. enter image description here enter image description here I wanted to replace comma to point in Python 2 (available in PoweAutomate desktop), but this variable is taken as tuple, I can't even join this elements. I wanted to parse Json object in Pyhton, but have error no module when trying toimport json. May be I should change numeric format enter image description here enter image description here

When I get answer I see dots, than when assigning to variables I see commas. enter image description here I got information from German software, as far as I understand, commas are used. May be I can somehow modify my SQL query to put the data in?

Elina
  • 23
  • 6
  • json is always text., so have you tried to replace the cpmma with a dot and then try to convert it – nbk May 09 '22 at 12:29
  • I've taken embedded function for replacement of chars in text, but it still doesn't work.. – Elina May 09 '22 at 13:47
  • no imean your text is 62,72 and double decimal float must have 62.72 with a dot. sql server is a bit difficult in that regard, every character that doesn't fit causes that error. so please try it with an dot – nbk May 09 '22 at 15:34

1 Answers1

0

I have found the solution - edit the sql query (next task is date format):

INSERT INTO vaouchers(totalGrossAmount(decimal(18,2)) VALUES replace("%totalGrossAmount%",",",".")
Elina
  • 23
  • 6