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 / Unable to upload a fil...
Power Automate
Answered

Unable to upload a file with using envoke web service

(0) ShareShare
ReportReport
Posted on by 6

Here is our request Body looks like:

siva_undamatla_1-1679340728966.png

 

We are unable to configure attachment in invoke web service in power automate desktop flow

 

Can anyone help me on this please!

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
  • siva_undamatla Profile Picture
    6 on at

    Thank you @Nived_Nambiar , to run the python script do we need to install python run machine?

  • siva_undamatla Profile Picture
    6 on at

    I am using Run Python script action and i pasted my script and executed, but there was not response, so do i need to install python in my run machine?

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @siva_undamatla 

     

    The Power Automate Desktop has out-of-the-box Python support.

    The action currently supports python 2.

     

    Could you please show the code by not showing the confidential part ?

     

    Have u used print function to print response ?

     

  • momlo Profile Picture
    1,527 Super User 2024 Season 1 on at

    @siva_undamatla 

    As far as I remember, PAD is using IronPython, see here for some more info how others handled that:

     

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Using-Python-Script-with-Modules-in-Power-Automate-Desktop/td-p/882774

     

     

  • Narotham Profile Picture
    2 on at

    Hi @Nived_Nambiar ,
    On Behalf of @siva_undamatla, please find the below screenshot which was using to upload a file with python script in Run Python Script Action but unable to upload a file.

    Narotham_0-1679555104992.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Narotham 

     

    Do one thing

     

    In the python script from line 13 starting with response =, press enter, this that part and part after that will moved to next line.

     

    Also in variables produced option in Run python script, enable the variable for getting script error. This variable will captures any error associated with the python code while running which would help to track the issue if found 

     

     

  • Vamsi_Envoy Profile Picture
    31 on at

    Hi @Nived_Nambiar,
    On Behalf of @siva_undamatla, i had modified same as per your suggestion=, and enable the Syntax Error in advacned options but i am getting the below Syntax error

    ---------Script


    File "", line 18
    response =,
    ^
    SyntaxError: unexpected token ','

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Vamsi_Envoy 

     

    Could u paste the python code here , I can correct it 

  • Vamsi_Envoy Profile Picture
    31 on at

    @Nived_Nambiar 
    Please find the Python Script 
    =============================

    import requests

    url = "http Url"

    payload={'baseDocumentId': '0DE4D6CB5A7D',
    'documentTypeId': '1400',
    'isReferenceDocument': 'true',
    'baseProfileIds': 'E9F5F493D3C6',
    'sendNotifications': 'false',
    'legalMatterId': '052999978554'}
    files=[
    ('file',('Capture.PNG',open('/C:/Users/Downloads/Capture.PNG','rb'),'application/octet-stream'))
    ]
    headers = {
    'Authorization': 'Bearer <token>'
    }

    response =,
    requests.request("POST", url, headers=headers, data=payload, files=files)

    print(response.text)

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
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 292 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 128

Last 30 days Overall leaderboard