I’m working on a document where I need to dynamically add rows to a table ([DB - All Files]) based on values selected in another table’s column ([Affected Packs]). Each row in [Affected Packs] is supposed to reference a row from a different table, and I’m trying to use these references to pull specific data (like sku) and use it in the AddRow function within a FormulaMap iteration.
Here’s the formula I’m using:
thisRow.[Affected Packs].FormulaMap(
AddRow(
[DB - All Files],
[DB - All Files].Product, CurrentValue,
[DB - All Files].Name, thisRow.[Full Most Recent Naming convention] + "-" + CurrentValue.sku
)
)
Issue:
I’m unable to access the sku property of the CurrentValue object within the FormulaMap. The CurrentValue is supposed to reference the selected row(s) from [Affected Packs], but CurrentValue.sku doesn’t seem to be linking or pulling the sku data.
Is there a specific format or technique I need to follow to access properties of a row object within a FormulaMap iteration?
Can you share your doc (or make a dummy doc)? From what you show us it is hard to see what is wrong. In case you want to share just with me: joostmineur@gmail.com
I also just noticed some additional information in the error. Coda is interpreting CurrentValue.sku as being part of thisRow.[Full Most Recent Naming convention] rather than ‘[DB - All Files].Product’ as I intend. Still not sure how to fix that though…
I fixed it to what I think you are trying to do. There is a new button so you can compare it with your button.
The show alert shows an error - but I don’t know why, because it is working fine. I will check with support on that.
edit: there was a nested ForEach that could result in a blank output, which is not allowed. Rewriting the formula solves it. See the shared document
I added a filter to prevent adding the same item every time you push the button.
Let me know if this is what you were trying to accomplish.
Thanks for looking! It was the button in the column I’ve just renamed ‘HELP ME’. The issue is I can’t access the SKU for the ‘current value’ in the formula.