Retrieve Specific Virtual ID From Report Based on Column Name
The Get Report module in Bridge does not allow us to specify a column the way the Get Sheet module does. How can I use the column name to pull the virtual ID for that column?
In the last screenshot containing the runtime data, I need to be able to reference the title to pull the virtual ID for a specific column.
Best Answer
-
I ended up solving this by first extracting the column names into one array, extracting the IDs into another array, and then using a JS module to find the index of the name array based on the column name and then output that same index from the second array.
ChatGPT gave me the JS, and it worked like a charm once I mapped my three variables.:
// INPUTS: referenceColumnName, arrayOfColumnNames, arrayOfColumnIDs // Find the index of the Reference Column Name in the Array of Column Names const index = arrayOfColumnNames. indexOf (referenceColumnName); // Initialize the output variable let output = null ; // Check if the index is valid if (index !== - 1 ) { // Get the corresponding Column ID from the Array of Column IDs output = arrayOfColumnIDs[index];} // OUTPUT: output (Column ID corresponding to the Reference Column Name) return output;
Answers
-
I ended up solving this by first extracting the column names into one array, extracting the IDs into another array, and then using a JS module to find the index of the name array based on the column name and then output that same index from the second array.
ChatGPT gave me the JS, and it worked like a charm once I mapped my three variables.:
// INPUTS: referenceColumnName, arrayOfColumnNames, arrayOfColumnIDs // Find the index of the Reference Column Name in the Array of Column Names const index = arrayOfColumnNames. indexOf (referenceColumnName); // Initialize the output variable let output = null ; // Check if the index is valid if (index !== - 1 ) { // Get the corresponding Column ID from the Array of Column IDs output = arrayOfColumnIDs[index];} // OUTPUT: output (Column ID corresponding to the Reference Column Name) return output;
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 138 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives