Editing the code behind Power Automate
Khizar Ansari
India D365 & Power Community User Group Leader | TCS Contextual Master Dec'24 | IIT Madras Alumni | TCS Digital Sep'21 | Dynamics 365 Finance and Supply Chain Technical Consultant | Microsoft Power Platform
Both #LogicApps and #PowerAutomate share the same underlying technology stack. While Logic Apps allows for direct editing of the JSON code through the code view, Power Automate does not offer this functionality natively.
However, I recently discovered a solution that works similarly, though it's not quite the same.
Problem Statement: How can one efficiently edit the JSON code behind Power Automate to achieve the desired output without spending excessive time and effort.
Scenario
I have a boilerplate text that is separated by the "\n" delimiter, and I need to split it into a list based on this delimiter. To achieve this, I used the "split" function in Power Automate and entered "/n" as the delimiter.
split(variable('Text_variable'), '\n')
However, upon running the flow, the result was not as expected. It did not split anything and returned an array with the complete sentence as one element.
If we click on the ellipsis button on the compose action we have a item called "Copy to clipboard (Preview)".
领英推荐
Upon pressing, a JSON code will be copied onto your notepad which looks like below and if you notice even though I put the delimiter as "/n" it was recorded as "//n" due to auto-escaping nature of Power Automate connectors.
Now we can remove the extra backslash (/). Select and copy the complete edited tchacode as below
Now try to add a new connector in the flow and switch to the "My clipboard" tab and you should be able to see you copied code automatically, if not then press Ctrl + V.
By hovering over the ? icon, you will be able to view the code and select the option that displays your modified code.
Now run the flow and you will see that now we have the desired output
This approach allows you to edit the code behind Power Automate, similar to how it's done in Logic Apps.
Aspiring Full-Stack Developer | Cloud Computing Enthusiast | Passionate About Scalable Solutions
4 周Interesting
TCS Digital | Speaker @Microsoft Reactor |D365 technical consultant I Generative AI | Power Apps | Customer Success Architect Team Member at Tata Consultancy Services| AI-900
4 周Great observation and explanation Khizar Ansari
Power Platform | Dynamics 365 Fin & Ops
4 周Interesting