# Pass Credential to Python code as input

**URL:** <https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834>\
**Category:** Studio\
**Tags:** python-invoke, activities-panel, question, studio, python, system, activities\
**Created:** [February 27, 2024, 2:59pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834 "2024-02-27T14:59:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erika.papp](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@erika.papp](https://forum.uipath.com/u/erika.papp)\
**Post date:** [February 27, 2024, 2:59pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834/1 "2024-02-27T14:59:09Z")

</div>

Hi,

I have a process where UiPath Get credential retrieve username and password from Orchestrator.  
The username and password need to be passed to a python code that logs in a system.  
Is there a way to pass variables (secure string) as input to python? I get the following error:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/e/0/3/e0397d699f486a49b539f7bfd2db104ca3db1dc6.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [February 27, 2024, 3:06pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834/2 "2024-02-27T15:06:58Z")

</div>

@erika.papp

Try `New Object(){username,password}`

Cheers

---

<div class="post-metadata">

**Author:** ![erika.papp](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@erika.papp](https://forum.uipath.com/u/erika.papp)\
**Post date:** [February 27, 2024, 3:23pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834/3 "2024-02-27T15:23:29Z")

</div>

> [@Anil\_G](#):
>
> New Object()

Thanks for your reply.  
I have tested but seems like password is not in the right form as an input:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/3/7/d/37da29cf638b69c421583a58297059fd37fa4e03.png)

---

<div class="post-metadata">

**Author:** ![efelantti](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@efelantti](https://forum.uipath.com/u/efelantti)\
**Post date:** [February 27, 2024, 3:43pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834/4 "2024-02-27T15:43:41Z")

</div>

Try to pass the password as a string instead. That could be done by replacing `password` with:

```auto
new System.Net.NetworkCredential("", password).Password

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [March 1, 2024, 3:44pm UTC](https://forum.uipath.com/t/pass-credential-to-python-code-as-input/722834/5 "2024-03-01T15:44:20Z")

</div>

Closed on March 1, 2024, 3:44pm UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
