new

  

Hi,

I am new in outsystems and i would like to ask a question about my mobile app. I consume a Rest Api with customers. I have 2 screens in my app. The first one has all  customers names and the second one i would like to have a table with details for each customer. How can i try this? I try everything like containers,lists, etc but nothing.


Regards,

Panagiotis

Hi Panagiotis,

Does your rest api have two methods?

One to get all Customers and one to get the Customer Details based on a Customer Identifier?

In the first screen you need to put a list and drop the rest api that gets all customers.

Then you need to create a link on page 1 that redirects to page 2 with the Customer Identifier as parameter.

Use this parameter to call the rest api for the Customer Details.

In the second screen you need a form and drop the rest api that gets the customer details.

Kind regards,

Remco Dekkinga

The detail screen should have an input parameter with customerId.

You will have to use the customerId in the aggregate filter used to retrieve the customer detail.

This means, when on your customer's overview page, when you click on the customer you will navigate to the detailscreen. Since it requires a customerId, you will set the current selected customerId as value for that input parameter.

If you are still having issues, upload your oml file, and i will explain how to in your OML

Hi again,

I have a single method to consume a rest api. I made an input parameter with name variable id and when i fetch data from my local storage for the second screen i have a filter like this variable id = customer.id.

The problem is when i touch in the name of customer(1st screen) then i go to the second screen with only the name of this customer and the other fields like address,phone,email are blanked.

Ans when the data is retieved from the rest api, those field are filled? Or also empty?

i have 5 fields and only the field of name is filled. The other 4 are empty

From your API call right? If that's the case, then the API is the issue not outsystems.
You are not getting the required information from your API call

My json has all these fields filled. So why my API cant called these fields?

A sample of my Json https://api.myjson.com/bins/zt47b

Hi,

Can you post the OML you are working on, because it looks like you're doing something else with the input parameter or the API call on the second screen than we think.

Kind regards,

Remco Dekkinga

hi, 

this is my file.

Hi Panagiotis,

I've checked your application and I found the cause of the problem. In the syncup you only assign the Id and the Name and that's why the other fields are empty.

Kind regards,

Remco Dekkinga

Damm Remco!

You where faster than me :(

hi guys,


The problem is the same as previous. I assign the other empty fields and i have the same result 

Hi,

Did you truncate the table and reload the data?

Kind regards,

Remco

Hi,

I reload my data again and my fields are empty. In your environment, do you run my OML and fields are filled?


Regards,

Panagiotis

Hi Panagiotis,

I've checked your oml and when assigning the phone, you should truncate the phonenumber at 20 characters, otherwise you get an error on the sync. phone = substr(phone,0,20);

When you still have trouble getting it to work, try to clear your local database:

In Chrome, click F12, go to tab application in the Development Tool, click Application > Clear storage and clear the site data.

Hope this works for you.

Kind regards,

Remco Dekkinga