Efficiency is key. PowerFx, the powerful formula language for Microsoft Power Platform, has revolutionized the way we approach coding. But what if you could elevate that efficiency even further? Enter Copilot, your coding companion that translates any code into PowerFx, ensuring you code smarter, not harder.

I created a Canvas app to demo and enter the code and then show the results.

Here are some examples of the code translation:

PHP example 1:

$cars = array("Volvo", "BMW", "Toyota");
echo count($cars);

In the app:

SpongYe_1-1718226907606.png

Results:

SpongYe_2-1718226975868.png

PHP example 2:

$favcolor = "red";
switch ($favcolor) {
  case "red":
    echo "Your favorite color is red!";
    break;
  case "blue":
    echo "Your favorite color is blue!";
    break;
  case "green":
    echo "Your favorite color is green!";
    break;
  default:
    echo "Your favorite color is neither red, blue, nor green!";
}

In app:

SpongYe_4-1718227057514.png

Results:

SpongYe_3-1718227046041.png

Python example 1: 

x = 5
print(type(x))

In app:

SpongYe_5-1718227252758.png

Results:

SpongYe_6-1718227350660.png

Python example 2: 

["apple", "banana", "cherry"]
print(len(thislist))

In app:

SpongYe_7-1718228715259.png

Results:

SpongYe_8-1718228760290.png

AI prompt:

I created a AI prompt to give an answer to transform the given input code.

The prompt has 2 input parametes: the code type and the code itself. 

SpongYe_9-1718228837594.png

Conclusion

PowerFx with Copilot represents a significant leap forward in app development. By bridging the gap between different coding languages and PowerFx, Copilot ensures that your coding journey is as efficient and effective as possible. Embrace the power of Copilot and transform the way you code with PowerFx.

Leave a Reply

Your email address will not be published. Required fields are marked *