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, 2022 in Others by Kithuzzz
• 38,000 points
1,270 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, 2022 by narikkadan
• 63,600 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, 2022 in Others by narikkadan
• 63,600 points
1,057 views
0 votes
1 answer

How to Convert Excel Cell Values Into Individual PNG Files?

This will: create a chart add an image to ...READ MORE

answered Dec 19, 2022 in Others by narikkadan
• 63,600 points
494 views
0 votes
1 answer

How to validate values entered in a multiline Excel cell?

Try: The formula in B1: =AND(BYROW(TEXTSPLIT(A1," "," ",1),LAMBDA(x,SUM((LEN(x)={3,7,4,4,5})ISNUMBER(-x)(MID(TAKE(x,-1),3,1)="."))))) Or, write a ...READ MORE

answered Jan 13, 2023 in Others by narikkadan
• 63,600 points
402 views
0 votes
1 answer

Excel VBA search based on cell values into folders and sub-folders to get the file path and data

This will create a listing of all ...READ MORE

answered Jan 19, 2023 in Others by narikkadan
• 63,600 points
2,078 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, 2022 in Others by Edureka
• 13,690 points
975 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, 2022 in Others by narikkadan
• 63,600 points
2,019 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, 2022 in Others by narikkadan
• 63,600 points
1,765 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

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

answered Oct 7, 2022 in Others by narikkadan
• 63,600 points
1,280 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, 2022 in Others by narikkadan
• 63,600 points
907 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, 2022 in Others by narikkadan
• 63,600 points
1,519 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