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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How do I write a simpl...
Power Automate
Unanswered

How do I write a simple c# code in power automate

(1) ShareShare
ReportReport
Posted on by 2

Hello Team, Please Like any other RPA tool I use code stage and invoke code . How do I write a c# code in power automate??

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at
    Re: How do I write a simple c# code in power automate

    I was going to say you might be able to do it through Run PowerShell Script...this is what GPT had to say:

     

    In Power Automate, the direct equivalent of writing C# code in a "code stage" as you might in other RPA tools like Blue Prism or UiPath isn't available in the same way. Power Automate focuses more on low-code, no-code solutions primarily using pre-built connectors and actions to integrate different services. However, there are a couple of ways you can integrate C# code or similar logic into your Power Automate flows:

    1. Power Automate Desktop: This tool allows you to automate desktop and web applications on a Windows machine. It includes a "Run PowerShell script" action, which you can use to execute scripts that may interact with C# assemblies or use inline C# code with Add-Type cmdlet. However, this is limited and not as direct as using C#.

    2. Azure Functions: You can write your C# code in an Azure Function and then call this function from Power Automate using the HTTP action. This is a powerful way to integrate custom code, as Azure Functions support multiple languages, including C#. This method involves writing your C# logic as a function in Azure, deploying it, and then invoking this function via HTTP requests.

    3. Custom Connectors: If you have repetitive C# logic that you need to use across multiple flows, you might consider encapsulating this logic into a custom connector. Custom connectors in Power Automate can be created to wrap any REST API, which you could host yourself (e.g., as an Azure Function or another cloud service). This allows you to write the logic in C#, expose it through an API, and then use it in your flows.

    4. HTTP Actions: Similar to using Azure Functions but more generic, you can host your C# code on any server that exposes it via HTTP(S) and call it using the HTTP action in Power Automate. This method requires you to manage the hosting and availability of your API.

    Here's a quick example of how you might set up a simple Azure Function in C# that you can call from Power Automate:

    Step 1: Create an Azure Function

    • Write a C# function that performs your desired task.
    • Deploy this function to Azure.

    Step 2: Call this Function from Power Automate

    • Create a new flow in Power Automate.
    • Add an HTTP action.
    • Configure the HTTP action to call your Azure Function, passing any necessary data.

    This approach lets you leverage the full power of C#, while using Power Automate to handle workflow integration and orchestration.

  • Suggested answer
    LogeeV Profile Picture
    2 on at
    How do I write a simple c# code in power automate
    You can do that through building custom connector, try and find youtube video: " PowerAutomate - How to Build Customer Connector with C# code in easy steps."
     
    If this answer your query, please mark my answer as Answered and like it. Thanks.

     

  • Suggested answer
    eetuRobo Profile Picture
    4,163 Super User 2025 Season 2 on at
    How do I write a simple c# code in power automate
    There are multiple scripting options

    with Run .NET script you can write C# code 

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard