How to use formula map table rows information to create rows in other table

Hello everyone,

I’m trying to create from a row button in table A, a new row in table B for each row in table C

I’m managing to do that with the formula:
FormulaMap(C, AddRow(B))

The thing is I want to use data from table A and C for new rows in B, and I can’t figure out to do the following

Use the “Name” of each row in table C when creating B Row

This is my latest result: All the C rows’ names are used instead of one
Formula : FormulaMap(C, AddRow(B,Content,thisRow.Content,C,C.Name))

If you could give me some help, it would be amazing !

Thanks

Matthias

3 Likes

Hey @Matthias_Riverti1,

I got your desired result with this Formula:
FormulaMap(C, AddRow(B,Content,thisRow.Content,C,CurrentValue.ToText()))

I think ‘Currentvalue’ stores the current object you are going through with FormulaMap.
You can also remove the “totext()” to get it as a connected row and not the text only.

EDIT: This is a perfect case of ‘how to ask for help’ :slight_smile: your example, current step and visualization makes it very clear what you want. Maybe others in need can take it as an inspiration.

6 Likes

I just applied Daniel’s solution for a similar situation in my own Doc. I can confirm that it does work.

However, it seems like CurrentValue is being misidentified and color coded as being from the wrong table. Table B, in this case. Because of this, I haven’t been able to select a different column from the CurrentValue row. I can only use the display column.

In this example, the Snacks can’t be copied to B:

1 Like

That is absolutely right. The problem: (as far as I know) you can not address a column of a linked row from a different table. (The same applies, when you have a table lookup and you want to address another column of that.)

I usually workaround it with filtering, but this can be dangerous if e.g. your values are not unique:

1 Like

This CurrentValue misidentification problem has been going for ages, always happens when you nest two formulas that use it (in this case FormulaMap and AddRow).

Another workaround is to Simulate a For Loop so you can access the Nth value of each of C 2's columns. This way you also avoid the possible problem of duplicates that @Daniel_Stieber mentioned.

See it working:

5 Likes

:100: ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌

Thanks a lot for the solutions !!
I tried @Daniel_Stieber one and it works great.

I do agree that the color bug is misleading. But I guess we are pushing the tool to the limit with that kind of usage.

I didn’t try your option @Dalmo_Mendonca, but it seems perfect for even more complicated use cases

1 Like