Recreate in retool something like this

Hi guys what you recommend me to replicate this in retool, i got a laravel app that im moving to retool, is a inventory management plus some other things. But basically manage stock transfers from location A to B, so for example when i do that in retool and change the status to completed, in my laravel i got this function in order to decrease the inventory from location A and increase it in Location B, what you guys recommend to do this using retool?

attached my functions

image

thank you

can you help me? @victoria @Kabirdas

Hi @agaitan026 Thanks for checking in!

Would you mind sharing a few more details about your app? Where is this data stored? Do you have it saved in a database or api? For example, if the locations' data is stored in a database table, I'd recommend writing a database update query that updates the quantities in each location.

1 Like

correct, all my info is in mysql db, i got a working app in laravel, but need to get rid of that, i attached the picture where is one of my function, so after i made a movement of inventory that function triggers, and update product qty so takes 1 from warehouse A and sum one to warehouse B, not sure if im being clear. at the end is a inventory management system

Hi @agaitan026 Instead of using a function, can you write an update query to MySQL that modifies the quantities? Is the user changing the status to completed inside a Retool table component?

1 Like

but how i do that? i have to save the qty in a variable or something? then how i sum values or subtract with mysql?

@Tess can you help me pls :slight_smile:

Hi @agaitan026,

There is very little information about the app you want to build and how your mysql looks like.

In basis you want to update 2 tables in your database. You’ll have to create a mysql resource in your app which update both tables on a event from your app.

You can do both actions in a single resource query and they would look like:

Update table1 set fieldqty = {{your app value}} where id = {{your record id}}

2 Likes