Copy multiple rows from Table A to one Row in Table B

Hi guys, thanks for your help in advance

Table A - Column 1, 2 & 3 are same (unique) values in Rows 1 & 2

I want to copy 

values from Table A - Column 1, 2 & 3 Rows 1 & 2      to      (single) Row 1 of Table B Column 1, 2 & 3

Copy from multiple rows of Table A to single row of Table B

is this possible? how?

Solved Solved
1 9 379
1 ACCEPTED SOLUTION


@Marc_Dillon wrote:

B
1. Use your existing setup, with multi-select on tableA record, and a bulk action. But instead of that bulk action creating the invoice record, have it just flag those tableA records in some way (set a value to some column that can be looked up later).
2. Add a second inline action, that only appears on the first flagged tableA record. This action will create the invoice record and set all tableA's [invoice] values to it (MAXROW again).


 

A clarification on a point that you apparently misunderstood:

These are 2 separate actions.

  1. One is for flagging the records first, you run this action in bulk across all records.
  2. The second is for creating the invoice with the flagged records. You only run this action once on a single record. MINROW is to be used in this action's show_if condition so that it only displays on a single one of the flagged records.

View solution in original post

9 REPLIES 9

What is the exact expected result? Show some examples.

Hi Marc, 

Thanks for reviewing. Kindly ignore the previous question. Let me rephrase this.

I have  charges listed in Table A. Some of the rows are grouped based on Job number. 

Table B Contains list of Invoices, with related rows from Table A at the bottom. (ref)

I want to create a work flow as follows.

STEP 1 - select Multiple lines in table A (Charges)

STEP 2 - Click a button called 'Create Invoice' in (Table A)

STEP 3 - this creates a new single row in Table B (Invoices)

STEP 4 - Copy this latest InvoiceID from Table B to selected Multiple rows in the Table A Charges

I am failing at, when i select multiple rows in Table A (charges), it is creating multiple rows in Table B (invoices) 

Thanks again for the help

final result

sathishk_0-1690997084002.png

 

Couple options here.

A
1. Have the user create the invoice first.
From there, there are 2 sub-options.
2a. Have them select tableA records from an enumlist column within the invoice form, then run a form save action to set all of the selected records' [invoice] column to the most recently created invoice (MAXROW).
2b. After saving the invoice record, nav to the tableA list view, where you'll have an inline action, or a multi-select action, to set each record's [invoice] column the same way.  

***MAXROW on a creation timestamp  or rownumber is typically fine for option 2a, but for option 2b you may need to setup an additional [flag] column on the invoice record, depending on your exact setup (to avoid selected records being assigned to the wrong invoice).

 

B
1. Use your existing setup, with multi-select on tableA record, and a bulk action. But instead of that bulk action creating the invoice record, have it just flag those tableA records in some way (set a value to some column that can be looked up later).
2. Add a second inline action, that only appears on the first flagged tableA record. This action will create the invoice record and set all tableA's [invoice] values to it (MAXROW again).

Good Morning Marc

I attempted the Option B as follows

sathishk_0-1692110741481.png

1.0 Set Invoice Action TRUE

sathishk_1-1692110789991.png

1.1 Select MinROW

sathishk_2-1692110880602.png

 

1.1.1 Create New Invoice

sathishk_3-1692110900694.png

 

1.2 Select rows with Invoice Action is TRUE

sathishk_4-1692110924531.png

 

1.2.1 Get Latest Invoice ID

sathishk_5-1692110942673.png

Error in selecting the MINROW

sathishk_6-1692110985585.png

not able to move past this

What am i doing wrong?

thanks

 

See how it says 'List' here:

Marc_Dillon_0-1692115133158.png

That's the data type that is expected/required. MINROW() only returns a single value. Just wrap it in LIST().

thanks for quick reply Marc, the error is gone.

However it is creating multiple invoices (if i select 3 rows it is creating 3 new invoices)

even though i understood 1.1 Select MinROW is refering to one row only in TableA

any direction on this?

What i want to do is create only one invoice even select multiple charges.

thanks 

sathishk_0-1692119916988.png

 

 

I tried adding one more step, SECOND ACTION Column marking the MINROW of INVOICE ACTION Column TRUE.

execute only for SECOND Action = TRUE to create Invoice

It was successful in marking only one row in the same table as TRUE

But i get the same error incase of another table.

Multiple invoice created for multiple selections

sathishk_3-1692197122298.png

 

sathishk_4-1692197138265.png

 

sathishk_5-1692197154215.pngsathishk_6-1692197168272.png

 


@Marc_Dillon wrote:

B
1. Use your existing setup, with multi-select on tableA record, and a bulk action. But instead of that bulk action creating the invoice record, have it just flag those tableA records in some way (set a value to some column that can be looked up later).
2. Add a second inline action, that only appears on the first flagged tableA record. This action will create the invoice record and set all tableA's [invoice] values to it (MAXROW again).


 

A clarification on a point that you apparently misunderstood:

These are 2 separate actions.

  1. One is for flagging the records first, you run this action in bulk across all records.
  2. The second is for creating the invoice with the flagged records. You only run this action once on a single record. MINROW is to be used in this action's show_if condition so that it only displays on a single one of the flagged records.

my bad, thanks for the clarification. Have a great day.

Top Labels in this Space