Pass multiple Excel cell values to Power Automate

0 votes
I'm transferring an Excel cell value from SharePoint to Power Automate using Office Scripts. I can figure out how to send the values of several cells, but it only seems to work for one cell. This is my most recent Office Script, which retrieves the value from cell B3. When I use Power Automate to call this, I can access the B3 value by referring to the "result" dynamic content from the Run Script action.

Additionally, I must provide Power Automate with the values from cells B4, B5, B11, B12, and B44. How can I go about doing that?
Nov 20 in Others by Kithuzzz
• 20,660 points
30 views

1 answer to this question.

0 votes

If you have certain data that you wish to return, such as the customer name, you can create an object with properties for each of those values. The values would then be returned to Power Automate as that object. The script would appear as follows:

function main(workbook: ExcelScript.Workbook): SelectedValuesToReturn {
    // Get the current worksheet.
    let selectedSheet = workbook.getWorksheet("Sheet1");
    //values of range
    let customerNameValue= selectedSheet.getRange("B3").getValue().toString();
    let b4Value = selectedSheet.getRange("B4").getValue().toString();
    let b5Value = selectedSheet.getRange("B5").getValue().toString();
    let b11Value = selectedSheet.getRange("B11").getValue().toString();
    let b12Value = selectedSheet.getRange("B12").getValue().toString();
    let b44Value = selectedSheet.getRange("B44").getValue().toString();
    return {customerName: customerNameValue, b4: b4Value, b5: b5Value, b11: b11Value, b12: b12Value, b44: b44Value}
  }
}

interface SelectedValuesToReturn{
  customerName: string,
  b4: string, 
  b5: string,
  b11: string, 
  b12: string,
  b44: string
}
answered Nov 20 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
1 answer

Excel dashboard using slicers when cell contains multiple values

All values in the column are displayed ...READ MORE

answered Oct 31 in Others by narikkadan
• 37,660 points
51 views
0 votes
1 answer

Change date format of cell in excel from dd.mm.yyyy to yyy/mm/dd ( excel version 2013 )

Hello :)   Excel’s Format Cells function can quickly ...READ MORE

answered Feb 9 in Others by gaurav
• 22,040 points
529 views
0 votes
1 answer
0 votes
1 answer

How to create a drop-down in excel with custom values

You can accomplish that using code rather ...READ MORE

answered Sep 25 in Others by narikkadan
• 37,660 points
67 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17 in Others by Edureka
• 13,640 points
109 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3 in Others by narikkadan
• 37,660 points
93 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3 in Others by narikkadan
• 37,660 points
69 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7 in Others by narikkadan
• 37,660 points
89 views
0 votes
1 answer

How to trigger Excel AutoFill using power Automate?

In PAD you may want copy the ...READ MORE

answered Sep 29 in Others by narikkadan
• 37,660 points
108 views
0 votes
1 answer

Repeated excel rows based on a cell with multiple values

You can use this query: let ...READ MORE

answered Oct 20 in Others by narikkadan
• 37,660 points
43 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP