Get newly created table ID
How can I get the table ID of a table that is created using the Tables: Create a copy of a data table action?
I can't just refer to it by name, because the name is dynamic:
Best Answer
-
If the formula is working, and you've tested the expected variations for the
my-name
field, then it's probably ok. The risk comes in with the fact that themy-name
field may have special characters that you didn't anticipate.In general, I recommend against dynamic output field names for a cosmetic reason like renaming the table, due to the risk of functional process problems.
I do like the idea of being able to enter a name for the table separately, so I encourage you to submit that as a product request.
5
Answers
-
I don't recommend using a dynamic output field name. It'll make your life a lot harder.
0 -
I used a dynamic field name because I want to control the name of that newly-created table. Any idea how I can do that?
0 -
This field formula works. Is it prone to break, though?
var str = "supplier-onboarding-tracker-" + fields["my-name"]; str = str.trim().toLowerCase().replace(/\W*-{2,}\W*/g, '--').replace(/(?!--)(\W+)/g, '-').replace(/^-+/g, ''); result = fields[str];
The resulting field has the table ID that I wanted.
0 -
Done!
0