Forum Discussion
Tables Called in Flow Not Found
- Sep 07, 2023
The error you are encountering in Power Automate (formerly known as Microsoft Flow) indicating that the table is "not found" typically occurs when the table name referenced in the 'List rows present in table' action doesn't match the actual table name in the Excel workbook. To resolve this issue, follow these steps:
- Check Table Names in Excel:
- Open the Excel workbook that your script is modifying.
- Make sure that the tables created by your scripts indeed have the names you expect (e.g., "Table1," "Table2," etc.).
- Explicitly Specify Table Names:
- In your script, explicitly set the names of the tables you create using the addTable method. For example, you can modify your script like this:
let Continuous_Tbl = workbook.addTable(selectedSheet.getRange("A1:AP25"), true); Continuous_Tbl.setName("Table1"); // Specify the table name explicitly Continuous_Tbl.setPredefinedTableStyle("TableStyleLight8");
Make sure that the table names in your script match the actual table names in Excel.
- Use the Correct Table Names in Power Automate:
- In your Power Automate flow, when using the 'List rows present in table' action, make sure you are providing the correct table name that matches the one specified in your script. If you explicitly named the table in your script (as shown in the previous step), use that name. If you didn't specify a name, use the default "Table1," "Table2," etc.
- Check SharePoint List Connections:
- Ensure that your SharePoint list connections are correctly configured and that you are working with the right list.
- Test Incrementally:
- To identify the specific step where the issue is occurring, try running your flow incrementally. For example, start by running just one 'Run Script' action and see if the table is created and named correctly. Then, add the 'List rows present in table' action and test it separately.
- Flow Debugging:
- Use the built-in debugging capabilities of Power Automate to inspect variables and outputs at each step of your flow to identify where the issue is occurring.
- Flow Logging:
- Add logging actions (e.g., 'Compose' actions with informative messages) at key points in your flow to help diagnose issues. This can provide more visibility into the flow's behavior.
By carefully checking the table names in your Excel workbook and ensuring that they match the names referenced in your script and Power Automate, you should be able to resolve the "not found" error and successfully list rows present in the tables in your flow.
My knowledge of this topic is limited, but I entered your question in various AI. The text and the steps are the result of various AI's put together.
My answers are voluntary and without guarantee!
Hope this will help you.
The error you are encountering in Power Automate (formerly known as Microsoft Flow) indicating that the table is "not found" typically occurs when the table name referenced in the 'List rows present in table' action doesn't match the actual table name in the Excel workbook. To resolve this issue, follow these steps:
- Check Table Names in Excel:
- Open the Excel workbook that your script is modifying.
- Make sure that the tables created by your scripts indeed have the names you expect (e.g., "Table1," "Table2," etc.).
- Explicitly Specify Table Names:
- In your script, explicitly set the names of the tables you create using the addTable method. For example, you can modify your script like this:
let Continuous_Tbl = workbook.addTable(selectedSheet.getRange("A1:AP25"), true);
Continuous_Tbl.setName("Table1"); // Specify the table name explicitly
Continuous_Tbl.setPredefinedTableStyle("TableStyleLight8");
Make sure that the table names in your script match the actual table names in Excel.
- Use the Correct Table Names in Power Automate:
- In your Power Automate flow, when using the 'List rows present in table' action, make sure you are providing the correct table name that matches the one specified in your script. If you explicitly named the table in your script (as shown in the previous step), use that name. If you didn't specify a name, use the default "Table1," "Table2," etc.
- Check SharePoint List Connections:
- Ensure that your SharePoint list connections are correctly configured and that you are working with the right list.
- Test Incrementally:
- To identify the specific step where the issue is occurring, try running your flow incrementally. For example, start by running just one 'Run Script' action and see if the table is created and named correctly. Then, add the 'List rows present in table' action and test it separately.
- Flow Debugging:
- Use the built-in debugging capabilities of Power Automate to inspect variables and outputs at each step of your flow to identify where the issue is occurring.
- Flow Logging:
- Add logging actions (e.g., 'Compose' actions with informative messages) at key points in your flow to help diagnose issues. This can provide more visibility into the flow's behavior.
By carefully checking the table names in your Excel workbook and ensuring that they match the names referenced in your script and Power Automate, you should be able to resolve the "not found" error and successfully list rows present in the tables in your flow.
My knowledge of this topic is limited, but I entered your question in various AI. The text and the steps are the result of various AI's put together.
My answers are voluntary and without guarantee!
Hope this will help you.
Is there anything wrong with the code provided below?
Is this code written so that it will create a table named 'Continuous_Tbl'?
The flow runs through all of the 'Run Script' actions without issue.
However, when it gets to the first 'Create item' action the flow errors, stating 'table not found', whether the table is named 'Table1' or 'Continuous_Tbl'.
When I use my 'Compose' action to call specifically 'Table1' in the 'List rows present in a table' I still get an error that the table is not found.
I have visually verified that the script is creating tables named 'Table1', 'Table2'...etc, and not 'Continuous_Tbl'. Why would this be if the script language is correct, if so?
// Create a table with format on range A1:AP25 on selectedSheet
let Continuous_Tbl = workbook.addTable
(selectedSheet.getRange ("A1:AP25"), true);
Continuous_Tbl.setPredefinedTableStyle
("TableStyleLight8");
- SergeiBaklanSep 08, 2023Diamond Contributor
In Office Script you need to set table name, something like
function main(workbook: ExcelScript.Workbook) { const sheet = workbook .getFirstWorksheet() const ref = "A1:B3" const range = sheet.getRange(ref) if (range.getTables().length==0) { const tbl = sheet .addTable(ref, true) tbl.setName("Continious_Tbl") } }
As a comment, Power Automate has now idea which sheet you selected and what is the active sheet. You need to define it by name or index.