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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issues running a scrip...
Power Automate
Unanswered

Issues running a script via Power Automate

(0) ShareShare
ReportReport
Posted on by 11

Hi

 

I have a flow set up which triggers on a form submission. The flow contains an office script that runs on my OneDrive. 

 

I am having an issue getting the script to run 100% of the time that the form is submitted. The script will only run ~50% of the time. When it fails I get the following error message in the 'Run Script' logs.

 

"message""We were unable to run the script. Please try again.\nYour file was not saved because we could not merge your changes with changes from someone else.\r\nclientRequestId: xxxxxx",
 
I am unsure what is causing this error. When triggering the script manually via Excel online it works every time and the script works ~50% of the time when running it as part of the flow.
 
When I have been testing the flow, I have been submitting the form in fairly quick succession, but the flow is always completed prior to submitting another form.
Categories:
I have the same question (0)
  • LP8821 Profile Picture
    11 on at

    Edit: More information on the flow and what it does in case it's relevant.

     

    The form submits information to 2 spreadsheets. 1 is a a shared spreadsheet and receives all the information from the submitted form, the other is a spreadsheet only I have access to and only receives the submitters email and submission time.

     

    The office script runs on the second spreadsheet, and will compare the current and previous submissions. If the submission time is >20 mins or the submitters emails are different, the script will return a value to the workflow. Whereby if the returned value matches a condition an email will be sent. 

     

    (Form submission > submission to spreadsheet 1 > submission to spreadsheet 2 > Office script > Condition > End flow)

  • Verified answer
    LP8821 Profile Picture
    11 on at

    I'm not sure if this has fixed the issue, or just a coincidence.

     

    I added a 15s delay into the flow after the spreadsheet has been updated, but before the script is run, this seems to have fixed the issue, and I have not encountered anymore errors.

  • Yutao Huang Profile Picture
    Microsoft Employee on at

    @LP8821 - Glad to hear the delay workaround fixed the issue for you.

     

    As far as I know, Excel Online uses a concept called "co-authoring" when there are multiple clients (in your case, Forms being one, and Office Scripts being another) working on the same workbook. Any participating co-authoring client won't directly make changes to the master workbook but to a local workbook session and the changes will periodically be synced back to the master workbook stored on OneDrive (or SharePoint). Later the changes will be propagated to other co-authoring clients of the same workbook so they can see these changes.

     

    In your case, I guess there might be a timing issue. It appears when Office Script kicks in, the changes made by the Form submission hasn't been synced to the master workbook yet. So adding some delays could help.

     

    BTW, since the "Get response details" action of the Forms connector can reliably retrieve the data of the current form submission that triggers the flow, I'm wondering if you would be able to directly use that data to compare with the previous data in the workbook. Just something for you to consider...

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard