Hey, I’m trying to convert prices in my app to different currencies so I’m using API for data about these currencies values. But I don’t want to make thousands of api calls whenever the user tries to change currency so I want to somehow save the result of 1 api call for a day and the repeat the call the next day and change saved data. Unfortunately I don’t really know how put this whole process to work so I’d appreciate help, thank you.
Create data type ‘Exchange rate’.
Field ‘From’ and field ‘To’. E.g From USD to GBP.
Field ‘Date’
Do a search for Exchange rate where From is X and to is Y where date > Current date/time + hours -24
Have a recursive backend workflow that runs daily to create a new exchange rate for each possible currency combination.
I think it’s over complicated to have a so many workflows for each currency combination. I’m just looking for a way to once a day do an api call for 4 currencies values and save it as something. Then when user creates an offer I’d just give it 2 values 1 - in this user’s currency and 2 - in dollars. Based on this when the user chooses to view offers in a certain currency I’d do a simple calculation with this offer’s dollars value and chosen currency. But again, idk how to create a workflow that once a day will make an api call and then a way to save these values
Recursive workflows.
How do I do it?
Okay, I’ve read this and I watched a few tutorials on yt but I can’t find out how do I actually involve in this workflow the API that gives me data about currencies?
Well what API are you trying to use?
Okay I figured it out, now the question is; how can I set a recurring event without something like a button that would trigger it, but something else that the user wouldn’t have any impact on. Just workflow that happens in the bg of my app and not user’s account
Or can I trigger this workflow with a button and then delete this button because workflow will be already set and scheduled for the next day, and then the next day…?