Forum Discussion

jbeta58's avatar
jbeta58
Copper Contributor
Jan 31, 2024

Get a row of an Excel table that contains Excel Custom Function using Power Automate

Hi,

 

I created a custom function in Javascript using the Yeoman generator and it is published as an Office Add-in, which runs successfully in my Excel Online and Desktop. Calculates the cost of an employee based on some input parameters (salary, salary type, benefits)

 
 
 

 

 

Now I want to use Power Automate to populate a table with different parameters and use the custom function on one of the columns of the table to retrieve the calculated value based on the parameters.

 

I created a flow using Excel's "Add a row to a table" and "Get a row" actions.

 

 

The first action (Add a row into a table) works fine as it enters the parameter values in each column of the table.

 

 

 


The second action (Get a row) partially works as it retrieves the values, but only those of the parameters, not the one where the custom function is, instead I get the #NAME? error.

 

 

 

If instead of using a custom function I use a native Excel function to do a test calculation, it works, I get the result of that test function.

 

The problem appears to be related to the way Excel updates the output of the Custom Function in the cell. I tried adding a Run Script action to update the workbook before the "Get a Row", but it doesn't work at all.

 

Do you have any idea how to solve this problem?

 

Thanks in advance for your help!

Resources