Rest API Mobile Same PAge

Rest API Mobile Same PAge

  

Hi,

I am trying to implement a REST API Consume from ISBN. I managed to call the API and if i look to the logs I can see i get a response.

{

    "book":

                                            

                                 {

                                                               "format":"Paperback",

                                                   "image":"https:\/\/images.isbndb.com\/covers\/39\/30\/9781159453930.jpg",

                                       "title_long":"doom-doom-3",

                                                                                                               "authors":["Groupe","Livres"],

                                       "title":"Doom: Doom 3, Id Tech 1, Doom II: Hell on Earth,Bestiaire de Doom, Id Tech 4, Final Doom, Doom 3: Resurrection of Evil,Whe",

                                       "isbn13":"9781159453930",

                                                               "isbn":"tech-1-doom-ii-hell-on-earth-bestiaire-de-doom-id-tech-4-final-doom-doom-3-id-1159453934"

                        }

                        

            

}

Now I did this with a Button where i defined the attached flow in attachment. I created two variables , one with the ISBNcode as input and a result as output. 

In the screen i have a input var that is the ISBN code and a expression that is equal to the variable result. That in the onclick flow corresponds to one of the api responses but this doesn't update the page with the api response info. Can someone help please?

Hi,

I noticed that at the end of the flow, you have a destination to the current screen. This causes the screen to refresh its contents and so the variable you used to store the information retrieved from the API is cleared.

In this case, you need to use an end node at the end of your flow, this way the variable where you stored the information is not cleared and it should be displayed on the screen.

Regards,

João

João Mateus wrote:

Hi,

I noticed that at the end of the flow, you have a destination to the current screen. This causes the screen to refresh its contents and so the variable you used to store the information retrieved from the API is cleared.

In this case, you need to use an end node at the end of your flow, this way the variable where you stored the information is not cleared and it should be displayed on the screen.

Regards,

João

Hi João, 

I tried with an end but still the expression field is not seen in the screen even after the API response. Are those steps correct? 


RRegards, 

João


Joao Siquenique wrote:

João Mateus wrote:

Hi,

I noticed that at the end of the flow, you have a destination to the current screen. This causes the screen to refresh its contents and so the variable you used to store the information retrieved from the API is cleared.

In this case, you need to use an end node at the end of your flow, this way the variable where you stored the information is not cleared and it should be displayed on the screen.

Regards,

João

Hi João, 

I tried with an end but still the expression field is not seen in the screen even after the API response. Are those steps correct? 


RRegards, 

João


How can I check what is inside a variable? To check if its grabbing something correctly. 


Hi

I would recommend encapsulating the REST API call in a server action to debug more easily, just to check if you are actually retrieving the information you want.

To check what is being stored in the variable in a client action you can debug your mobile application. Debugging in Mobile Applications is different than debugging server actions. To do this, I would recommend watching the debugging lesson in the Mobile Developer Course, if you haven't already.

Cheers,

João