web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automate Excel to Sale...
Power Automate
Unanswered

Automate Excel to Salesforce

(0) ShareShare
ReportReport
Posted on by 2

Hi, we have a task list on Excel in our shared drive and when someone completes a task for a specific client they put their initials in the box for that task. So as an example a row would be the clients name and then 5 or so cells each for a specific task and when anyone completes those task they put their initials in that cell.

We want to create corresponding check boxes in that clients record in Salesforce and using power automate when a team member places their initials in that cell it would check off the corresponding checkbox in Salesforce.

I seem to be struggling on making this happen.

Jeremy

Categories:
  • sumurthy Profile Picture
    Microsoft Employee on at
    For this scenario you can use Office Scripts, which allows a TypeScript language based script to be run on Excel file stored in OneDrive or SharePoint.
    Checkout this site for more details about using Office Scripts in Power Automate. It is available as Run Script action under Excel online flow. 
    You can create Office Script in Excel online using Automate tab.
     

    For step by step instruction see https://youtu.be/dVwqBf483qo (though it is for a different scenario) 

     
    For your scenario, you'll need the following: 
    1. Run a script against the Excel file to generate an array of records. 
    2. Use that to update Salesforce. 
     

    Input table

     

    <see image in the next message. this system is pretty buggy... doesn't allow me to insert image properly>

     

    Script

     

     

     

    function main(workbook: ExcelScript.Workbook): BasicObj[] {
     const sheet = workbook.getWorksheet('Sheet7');
     const table = sheet.getTables()[0];
     const dataRows = table.getRange().getValues() as string[][];
     // or
     // const dataRows = sheet.getUsedRange().getValues();
     const output: BasicObj[] = returnObjectFromValues(dataRows);
     console.log(output);
     return output;
    }
    
    /**
     * This helper funciton converts table values into an object array.
     */
    function returnObjectFromValues(values: string[][]): BasicObj[] {
     let objArray = [];
     let objKeys: string[] = [];
     for (let i = 0; i < values.length; i++) {
     if (i === 0) {
     objKeys = values[i]
     continue;
     }
     let obj = {}
     for (let j = 0; j < values[i].length; j++) {
     obj[objKeys[j]] = values[i][j]
     }
     objArray.push(obj);
     }
     console.log(JSON.stringify(objArray));
     return objArray;
    }
    
    interface BasicObj {
     [key: string]: string
    }

     

     

     

     

     
     

    Output (send this to your salesforce step)

     

     

     

     

    [{
    	"Client name": "Google",
    	"Publish blog": "TJ",
    	"Send confirmation": "",
    	"Review result": "LK"
    }, {
    	"Client name": "Microsoft",
    	"Publish blog": "MD",
    	"Send confirmation": "ML",
    	"Review result": ""
    }, {
    	"Client name": "Apple",
    	"Publish blog": "CO",
    	"Send confirmation": "",
    	"Review result": ""
    }]

     

     

     

     

     

  • sumurthy Profile Picture
    Microsoft Employee on at

    ti.png

  • NHCC Profile Picture
    2 on at

    Is there a way to do it without coding? I thought with Powerautomate, we could create steps that would be easy almost like building blocks?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard