20
Views
13
Comments
data not populating from db for the dropdown field in edit screen.

Hi Team,

I need help with getting data to a dropdown field on a web screen .

I have a dropdown list and I am able to select a state from the list of states and I am bale to save it to database. But when I am trying to edit the same content from the web screen, the drops down is not able to display the data (from the database) on the screen, which was inserted previously from the drop down widget. 

Please help how to show the data from the database in the same dropdown filed. Thanks in advance.

Regards,

Madhu

Rank: #166

Hi Madhu,

Can you share your code or some prints in a way we understand better the problem?

Are you using reactive or traditional apps?

Do you have an aggregate associated with this dropdown?


Cheers and Regards,

RR :)


Rank: #1261

Raphael Ranieri wrote:

Hi Madhu,

Can you share your code or some prints in a way we understand better the problem?

Are you using reactive or traditional apps?

Do you have an aggregate associated with this dropdown?


Cheers and Regards,

RR :)


 Hi Raphael,

Unfortunately I cannot share the code, I am using Traditional web app only, I have created a static entity called "Sates" which has list of states and these states will appear in the screen as a dropdown, and I am able to select a state and save the details to database. 

And I have another screen (I am using the same screen for edit/update mode) when I open the screen the dropdown field "state" is blank it is not showing the data which is already present in the database.

I need to populate the dropdown filed with the data, which is entred with the same dropdown field. Please help me how to do this. Thanks.

Regards,

Madhu


 

 

Rank: #166

Ok Madhu,

Lets try to check some basic things that can help...

When you have a combo box in traditional web you usually have 2 attributes that you mainly use.

One of them is the source of your combo, which can be: a List Var, a List from an Aggregate or even an entity we see it here:


It will say what elements will appear in your combo box!


The other important element is your variable, that will hold your current value.
And you can see here:



To be able to start the combo box with a filled value.

The value of your variable must be present in your source list.

For example, lets say your source list is:

ID    NAME       IsActive

1      New York    True

2      Boston        True

3      Chicago      False


And your variable have the FK from state of Chicago that is 3.

It will show in your combo selected once you opened the screen.


However, if you want to show only the actives states, and apply a filter in your source list to show only the states that have the attribute IsActive = True...

Your source list will return as:

ID    NAME       IsActive

1      New York    True

2      Boston        True


And since your variable value is 3.

The combobox will be empty.


What can be happening in your case is something similar.

Your source list may not have the value used in your variable associated with your combo box.


Let me know if this helped :)



Rank: #1261

Raphael Ranieri wrote:

Ok Madhu,

Lets try to check some basic things that can help...

When you have a combo box in traditional web you usually have 2 attributes that you mainly use.

One of them is the source of your combo, which can be: a List Var, a List from an Aggregate or even an entity we see it here:


It will say what elements will appear in your combo box!


The other important element is your variable, that will hold your current value.
And you can see here:



To be able to start the combo box with a filled value.

The value of your variable must be present in your source list.

For example, lets say your source list is:

ID    NAME       IsActive

1      New York    True

2      Boston        True

3      Chicago      False


And your variable have the FK from state of Chicago that is 3.

It will show in your combo selected once you opened the screen.


However, if you want to show only the actives states, and apply a filter in your source list to show only the states that have the attribute IsActive = True...

Your source list will return as:

ID    NAME       IsActive

1      New York    True

2      Boston        True


And since your variable value is 3.

The combobox will be empty.


What can be happening in your case is something similar.

Your source list may not have the value used in your variable associated with your combo box.


Let me know if this helped :)



 Hello Raphel,

Let me explain the case here:

I have a Main Screen which will call another screen (Student Details) for 2 operations  "Add details" and "Edit/Update" details.

So I am calling the same "Student Details screen" for both the operations from the main screen.

When I doing "ADD details" I have a drop down and able to select a state from the list of states and able to save it to the database, and I can see the details in the main screen which I have added just now.

Next when I am doing an "EDIT/Update" operation (by selecting an existing record from the Main Screen) it will show all the details of a record in "Student Details" screen, but here the screen it is not showing or populating the "State" value in the Stduent Details screen. This is the issue here.

State Dropdown is working properly and there is no issue with it.

But when I select edit/update a record it is not populating the data from the database for the "State" field. I verified the database data is present and it is proper data.

Please help, thanks in advance.

Regards,

Madhu


 

Rank: #166

Also, note that in my preparation I have two different aggregates to get the list that will be used by the combo box, and other one to get the info for the object that I was editing:


Hi Madhu,

please try this sample application.

Hope it's help :)

Good Day :)

Regards,

Samiksha

DemoApplication.oml

Champion
Rank: #131

Hi Madhu,

Please refer below example

https://amit-verma331.outsystemscloud.com/DemoFile/StudentDetails.aspx

This is your requirement right?

Please let me know if you have any query

- AV

Thanks

Rank: #1261

Amit Verma wrote:

Hi Madhu,

Please refer below example

https://amit-verma331.outsystemscloud.com/DemoFile/StudentDetails.aspx

This is your requirement right?

Please let me know if you have any query

- AV

Thanks

 Hi Amit,

In your example can you please add a link to the landing page to edit the record details, and once you click on the edit page it should display the details in the (New Student Detail )same screen where you have added the details to database.

So when you try to edit the record the screen should populate the value of Sate value, In my case the sate is not populating the data from the data base. This is my concern here.Thanks.

Regards,

Madhu

 

Champion
Rank: #678

Hi Madhu,

Can you refer the below link for the same.

https://vipasha-sharma1997.outsystemscloud.com/Test/WebScreen1.aspx?(Not.Licensed.For.Production)=

If this is you requirement then please find the attachment above

Regards,

Vipasha

Test.oml

Rank: #1261

Vipasha Sharma wrote:

Hi Madhu,

Can you refer the below link for the same.

https://vipasha-sharma1997.outsystemscloud.com/Test/WebScreen1.aspx?(Not.Licensed.For.Production)=

If this is you requirement then please find the attachment above

Regards,

Vipasha

 Hi Vipasa,

This is almost similar to my requirement, but the main difference is the actual data is coming form an external database, and for the State dropdown which I am using, I have created a static entity in my modules itself. So whatever is selected from drop down is going to the database, but during an Edit or update operation it is not showing the value for State filed. I have already tried the way you mentioned in the sample oml, but it did not worked for me. Thanks for the help.

Regards,

Madhu

 

Rank: #166

Madhu,

What variable are you using to hold your combo box state value? Can you send a print of just this info?

If your dropdown have the correct list, but when you open the screen the value is not filled, and the data in the database is ok, I believe that the variable that is associated with your dropdown and you are using may be empty.


The variable would be this one:


Did you checked if, the variable that you used, is with any value when debugging?

And just to make sure, in your data model... a student can have only one state, right?

There are not a many to many table like StudentState...

Cheers and Regards,

RR :)

Hi,

Do you want to combine external data and Static entity data and then want to save that data in your application database?

Can you please explain you requirement?

Regards,

Samiksha