Hey everyone,
I have the following challenge. I'm storing travel expenses in an item list. The expenses could be in various currencies. I'd like to get the exchange rate automatically for each row (because the exchange rate might be different for different dates and currencies).
The API GET call is: https://kurs.resenje.org/api/v1/currencies/<CODE>/rates/<YEAR>-<MONTH>-<DAY>
I have <CODE> in DET_Att6 and the <DATE> in DET_Att3.
The response is a JSON:
{
"code": "USD",
"date": "2017-01-04",
"date_from": "2017-01-04",
"number": 1,
"parity": 1,
"cash_buy": 117.7702,
"cash_sell": 119.4306,
"exchange_buy": 118.2446,
"exchange_middle": 118.6004,
"exchange_sell": 118.9562
}
What I wanted to do was:
- make the user insert all the information in the row;
- after that the user has to click the button in the row that would make the API call and save the "exchange_middle" in a column (e.g. DET_Att5)
Does anyone has any ideas how to implement that? Or, any ideas to do it differently?
Any tips will be much appreciated!
Cheers,
Martin