How to store data from input variables to a database and then use in another screen?
Application Type
Reactive
Service Studio Version
11.11.0 (Build 42742)
Platform Version
11.9.1 (Build 20359)

Hello everyone!


I am having trouble storing the data in the input variables from my screen to a database instance. As show in this picture, I have 4 fields where a user needs to type in this information and after they click on submit, the data needs to go into a database table which has the same attributes.

I am not sure how to get the data from the input fields into this database table. I tried using a fetch server action called GetTableDesiredProds with an output variable called ProductOutputList as shown which has the attributes from the table I made. Then I went to my screen and tried mapping my input field to the Putput variable of this server action and used the List.Current function.

But now I don't know what to do after the user enters the info in the form above and then clicks on submit. I know I need some functionality in the SubmitOnClick function, but how do I make it work?

Any help would be highly appreciated.


Thanks,

ZK

oml file.

Demo.oml

Hi Shubham,


Thanks for taking the time to help me out here and I apologize about the late reply, I was on leave. I used your oml to fix my logic. I am able to store the data in the database now but after this data is stored I need to use it in another screen. I am not sure how to figure that one out. This was my first screen where you helped me out. The fields above the black highlighter are already prepopulated and the fields after the black line is what the user is filling out. The data from this is going to be stored in a database instance.

I have implemented functionality where everything in this form will be stored in the database as I referenced your oml. However, I need to use that data in another screen which has the same fields and this was my second requirement.

So I need an if condition, if process order number from the first screen = the process order num in second screen, then just get all relevant data from the database related to that process order num. I am unsure how to use the desiredproducts table in my second screen and get the data I need.

Would really appreciate your input here.

Thanks,

ZK

Hi ZK,

in the SubmitOnClick, you can create a local variable of type Entity DesiredProducts. Then assign all the values entered in the UI to that variable. 

  • i.e. DesiredProducts.Class = ClassName

Finally you call Entity action CreateOrUpdateDesiredProducts with the created local variable assigned to it.

Regards

Hi Jose,

I apologize about the late reply, I was on leave.

So I tried your method but the local variable I made in the submitonclick action is not accessible in the UI that I have. It just doesn't show that variable so then I used the fetch data from database action which has a list output and used that in my UI instead. Now, I am unsure how to use the data from this list variable in my other screen. Any help would be appreciated.

Thanks,
ZK


Hi  ZK,

I have shared my oml file you can refer that oml file.

If my oml solves your problem kindly mark as solution.


Contacts.oml

CS

ContactsCS.oml

Hi Vinay,

Your oml could not be opened with Outsystems. I don't know if this is the correct format.

Thanks,
ZK

Hy ZK,

thanks for query, I have attached oml file and screenshot which replicate same model you have created.

Kindly lets us know this worked or not.

Thank you. Good day

Shubham

MergedImages.jpg

oml file.

Demo.oml

Hi Shubham,


Thanks for taking the time to help me out here and I apologize about the late reply, I was on leave. I used your oml to fix my logic. I am able to store the data in the database now but after this data is stored I need to use it in another screen. I am not sure how to figure that one out. This was my first screen where you helped me out. The fields above the black highlighter are already prepopulated and the fields after the black line is what the user is filling out. The data from this is going to be stored in a database instance.

I have implemented functionality where everything in this form will be stored in the database as I referenced your oml. However, I need to use that data in another screen which has the same fields and this was my second requirement.

So I need an if condition, if process order number from the first screen = the process order num in second screen, then just get all relevant data from the database related to that process order num. I am unsure how to use the desiredproducts table in my second screen and get the data I need.

Would really appreciate your input here.

Thanks,

ZK

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.