How to pass variables as parameters in the "invoke python method" in UIPath

How to pass variables as parameters in the “invoke python method” in UiPath
I used a For Each file in Folder loop, I am getting each file. How do i pass this file as a input parameterto the “invoke python method” in Python activities in UiPath.

@PAJ1999

Welcome to the community

This is how you do it

{currentItem.FullName}

Cheers

Is there something wrong with my python scope , I put a message box inside “Do” but still it doesnt get printed.
I feel my python scope is the issue

@Anil_G I am using python version 3.10

@PAJ1999

Your path should be the python.exe file path…please correct it

Cheers

@Anil_G I am getting an error when i use python.exe’s path.
image

Can you show me the folder at which python is installed?
By default it will be something like this:
C:\Users<Username>\AppData\Local\Programs\Python\Python310

Use library path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python310.dll”

Use path as: “C:\Users<USERNAME>\AppData\Local\Programs\Python\Python310\python.exe”

@PAJ1999

Looks like the path is wrong…

Please check this step by step guide

https://docs.uipath.com/activities/other/latest/user-guide/invoking-a-python-script

cheers

  1. Library path → This should be the path to the .dll file

  2. Path → This should be the path to the FOLDER containing python.exe
    Example:

  3. To send parameters into a Python method from UiPath, send in an array of variables where the position of variables are the same as the position of arguments in the Python method, e.g.

def sum(arg_a, arg_b, arg_c):
     return arg_a + arg_b + arg_c
  1. Then your UiPath code would be as below. Take note to add a Load Python Script activity pointing at your .py file before using Invoke Python Method

See this guys , my scope is fine right , but still the message box inside ‘Do’ is not printing when i run , please guide me

@yikwen.goo please check this

Please try installing .Net 5.0 runtime.

After installing, try re-run the bot.

Any logs generated when you run?

no logs are generated

Can you share your workflow? Also take a screenshot of the Output panel when the robot runs?