Save text to a database

0
Hi,  I have an idea and don't really know how to make it work.  So: I have an app that displays random food recipes from an API when a button is pressed. The next thing I want to implement is a save button for the user to save a certain recipe wich he likes.  Do you guys have some recomandations on how to do that? Maybe even some documentation links. 
asked
6 answers
0

So you got the API call up and running, that creates a non-persistent object and show it on a page. And a button ‘Like’.

To add your requirement add a microflow to that button, make it:

  • create an object of a persistent entity,
  • copy the attributes from the NPE
  • save it

 

answered
0

Mind that you have not yet committed the new object ‘savedRecipe’. Mark the checkbox next to commit and you will see the little icon with arrow-up appear:

answered
0

Ah! See where you are going wrong. You need the button to be in the Listview. So do this:

  1. To your ‘saveRecipe’-microflow:
    1. Add an input parameter ‘CurrentRecipe’
    2. Copy-paste all attributes from ‘CurrentRecipe’ to ‘savedRecipe’
  2. Drag and drop button “Save recipe” a bit down into the listview; This will automatically assign ‘JSONObject’ as the object to pass to your microflow.
answered
0

Hi Tim, 

Thank you for your help. I managed to do the following: Create a persistent entity that has all the atributes from the NPE.

I am a bit confused about the saving it part and about the microflow doing those requirements. My microflow currently looks like this: 

Thank you very much!

answered
0

Tim, sorry to bother you with so many questions. I have found the commit option and checked it. The thing is that my logic is like this: 

Here I get the desired text from the API. The response is displayed on web view and is being refreshed using a button so that I can get another recipe and so on. 

 

The next part I want to accomplish is the one asked above in my first message. I want to store a specific recipe in a database. So, to be as specific as I can, how can I store that response in a database, from which later on I can access to display a list of saved recipes.

Thank you very much for your help and patience!

 

answered
0

Hi. I am not sure if I follow your instructions correctly. I can't figure out a method do copy-paste the attributes, I can only select them one by one. It is not a real problem but I am not sure that I am doing what you told me to do.

answered