Copy rows from one table to another table

Copy rows from one table to another table

  

Hi there,

I'm relatively new to OutSystems and struggling to work out how to configure an Action to copy rows from one table to another table. The use case is: I have a table with base cost rates for Job Roles. I then want to create a rate card, based on a percentage uplift. The screen below;

Screen is based on a parent-child structure (Rate Card & Rate Card Lines). On the Parent, you select the Base Cost that you want to base rate card on and then select 'Generate Rate Card Lines' - it is the underlying action that I am struggling with... here is a screenshot of what I tried so far;

Any assistance appreciated!


From what I think you are asking, It looks like you're copying information from one entity to a similar, but different entity.

What you're going to want to do is add a Local Variable to the CreateRateCardLines action of type RateCardLines.

then add an assign statement before the CreateRateCardLines in the For Each which sets up that Local Variable with all of the information from the BaseCostLine that you're copying plus the percentage uplift that the user had entered.  Then use that as the source of the CreateRateCardLines.  Each time you'll be changing the data in that local variable and using it to create a the new RateCardLines.

Is this what you are looking for here?

Hi Leon Verster,


Well the Explination of Jordan was excellent, just as a final comment don't forget use an ajax refresh, this refresh the copy table and you will see your changes in that moment.

Regards.