![]()
In this โCustom Connector in Copilotโ article, we will learn how to call a custom connector in Copilot or how to add actions to Copilot using Connector. For this demo, already I have created a custom connector in Power Automate that calls the Currency Conversion Third Party API of Currency Beacon, which will convert any โfromโ currency to โtoโ currency with the live data.
Custom Connector in Copilot: Add Actions to Copilot Using Connector
It is a two-step process; first we need to create a custom connector in Power Automate, then we need to add that custom connector as an action in Copilot Studio. Letโs get started with the demo.
Create Custom Connector in Power Automate
Below is my list of custom connectors I have created in my Power Platform environment. For this demo, I will refer to the below โCurrency Beacon 3โ custom connector in my Copilot Studio Topic.
I would recommend you go through my previous article on how to create a custom connector in Power Automate from scratch, where I have explained how I have created the below Currency Beacon Third Party API custom connector.

Add Custom Connector in Copilot Topic
Login to the Copilot Studio portal and create a custom topic where you add a few phrases as per your topic and API or Custom Connector requirement. As my custom connector API is related to currency conversion, to trigger my topic, I have added the below phrases:
- Custom Connector
- Currency Conversion
- Currency

Then, add an โAsk with adaptive cardโ node.

Click on the three dots (ellipsis menu), then click on โPropertiesโ.

Replace the default JSON with the below JSON:
{
ย "type": "AdaptiveCard",
ย "body": [
ย ย {
ย ย ย "type": "TextBlock",
ย ย ย "text": "Currency Conversion",
ย ย ย "weight": "Bolder",
ย ย ย "size": "ExtraLarge",
ย ย ย "color": "Accent",
ย ย ย "horizontalAlignment": "center",
ย ย ย "spacing": "Large"
ย ย },
ย ย {
ย ย ย "type": "TextBlock",
ย ย ย "text": "Please enter the details below for currency conversion.",
ย ย ย "wrap": true,
ย ย ย "size": "Medium",
ย ย ย "weight": "Lighter",
ย ย ย "color": "Good",
ย ย ย "spacing": "Medium"
ย ย },
ย ย {
ย ย ย "type": "Input.ChoiceSet",
ย ย ย "id": "fromCurrency",
ย ย ย "label": "From Currency",
ย ย ย "placeholder": "Select a currency",
ย ย ย "isRequired": true,
ย ย ย "errorMessage": "Please select a 'From Currency'.",
ย ย ย "choices": [
ย ย ย ย { "title": "USD - US Dollar", "value": "USD" },
ย ย ย ย { "title": "EUR - Euro", "value": "EUR" },
ย ย ย ย { "title": "GBP - British Pound", "value": "GBP" },
ย ย ย ย { "title": "JPY - Japanese Yen", "value": "JPY" },
ย ย ย ย { "title": "AUD - Australian Dollar", "value": "AUD" },
ย ย ย ย { "title": "CAD - Canadian Dollar", "value": "CAD" },
ย ย ย ย { "title": "INR - Indian Rupee", "value": "INR" }
ย ย ย ],
ย ย ย "style": "compact"
ย ย },
ย ย {
ย ย ย "type": "Input.ChoiceSet",
ย ย ย "id": "toCurrency",
ย ย ย "label": "To Currency",
ย ย ย "placeholder": "Select a currency",
ย ย ย "isRequired": true,
ย ย ย "errorMessage": "Please select a 'To Currency'.",
ย ย ย "choices": [
ย ย ย ย { "title": "USD - US Dollar", "value": "USD" },
ย ย ย ย { "title": "EUR - Euro", "value": "EUR" },
ย ย ย ย { "title": "GBP - British Pound", "value": "GBP" },
ย ย ย ย { "title": "JPY - Japanese Yen", "value": "JPY" },
ย ย ย ย { "title": "AUD - Australian Dollar", "value": "AUD" },
ย ย ย ย { "title": "CAD - Canadian Dollar", "value": "CAD" },
ย ย ย ย { "title": "INR - Indian Rupee", "value": "INR" }
ย ย ย ],
ย ย ย "style": "compact"
ย ย },
ย ย {
ย ย ย "type": "Input.Number",
ย ย ย "id": "amount",
ย ย ย "label": "Amount",
ย ย ย "placeholder": "Enter the amount to convert (e.g., 100.50)",
ย ย ย "isRequired": true,
ย ย ย "errorMessage": "Please enter an amount greater than 0.",
ย ย ย "min": 0.01
ย ย },
ย ย {
ย ย ย "type": "TextBlock",
ย ย ย "id": "errorMessage",
ย ย ย "text": "",
ย ย ย "color": "attention",
ย ย ย "weight": "Bolder",
ย ย ย "isVisible": false,
ย ย ย "horizontalAlignment": "Center"
ย ย }
ย ],
ย "actions": [
ย ย {
ย ย ย "type": "Action.Submit",
ย ย ย "title": "Convert",
ย ย ย "data": {
ย ย ย ย "fromCurrency": "{{fromCurrency}}",
ย ย ย ย "toCurrency": "{{toCurrency}}",
ย ย ย ย "amount": "{{amount}}"
ย ย ย }
ย ย }
ย ],
ย "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
ย "version": "1.3"
}
Then, you can visualize your adaptive card like below:

You can design your adaptive card using the adaptive card designer tool.
Notes:
- It is not mandatory to call your custom connector; you need to create an adaptive card. You can even directly call your custom connector as an action and display the output in the message node.
- My demo is about currency conversion, which means the user needs to select โFromโ and โToโ currencyโ, then need to enter an amount. Once the user clicks on the convert button, my custom connector will be called and executed, and then I will see the converted currency rate. It is a live system.
- In this adaptive card, I have considered the validation as well, like none of the fields the user can pass as empty; the source currency and target currency should not be the same. The amount must be greater than zero.
- I have passed these outputs โfromCurrency,โย โtoCurrency,โ and โamountโ to my custom connector action as input parameters.
Add custom connector as an action to Copilot
Click on the add node symbol, then click on the โCall an actionโ menu.
Go to the connector tab. Search your connector with โCurrencyโ or whatever the name you created with.
Then, you will see a list your custom connectors that you have created in Power Automate. Select your custom connector action that you want to call. I have selected my currency conversion connector action, which will convert currency from source currency to destination currency, or โFrom currencyโ to โTo currency.โ.

Then, pass the from currency to currency and amount parameters from the adaptive card output.

If you notice, in the adaptive card, the amount output displays as a string; we need to convert this string to an integer. For that I have passed the amount as โValue(Topic.amount)โ using the formula.

Convert the Custom Connector Output to Record
The output of the custom connector displays as any datatype, so we need to convert this โConvertFromSourceToDestinationโ variable to Record Datatype.
For that, add a โParse valueโ node from the add node, then the variable management menu.
For parse value input, pass the custom connector output variable.
Select datatype as โFrom sample data.โ
Add Parse value node in Copilot studioClick on the โGet schema from sample JSONโ.
Enter your sample JSON, I have entered my sample JSON in this box:

My sample is as below:
{
ย ย "meta": {
ย ย ย ย "code": 200,
ย ย ย ย "disclaimer": "Usage subject to terms: https://currencybeacon.com/terms"
ย ย },
ย ย "response": {
ย ย ย ย "timestamp": 1727448277,
ย ย ย ย "date": "2024-09-27",
ย ย ย ย "from": "USD",
ย ย ย ย "to": "EUR",
ย ย ย ย "amount": 1,
ย ย ย ย "value": 0.89400618
ย ย },
ย ย "timestamp": 1727448277,
ย ย "date": "2024-09-27",
ย ย "from": "USD",
ย ย "to": "EUR",
ย ย "amount": 1,
ย ย "value": 0.89400618
}
Click on the โConfirmโ button. Then, click on โSave asโ and create a new variable, and then automatically the datatype will be changed to โRecord.โ.

The final step is to add a message to display the result in the chatbot panel.
Add a message node to display the result.
Finally, I have added the below message node and passed the below text:
You have converted this amount โfromโ to โto,โย and the converted value is this.

In the above message box, I have passed the from currency, to currency, and amount from the adaptive card output variables, and for converted value, I have extracted the value from the record variable using the below formula:

By now all setup is done for my Copilot topic. Letโs go with testing.
Test your Call Custom Connector Copilot Demo
I just typed the below text in my Copilot chatbot in test mode:
โI want to convert currency from USD to EUR, please help me, how can I do?โ
And immediately custom topic got triggered, and I can see my currency conversion adaptive card.

I have selected source currency as โUSD,โย to currency as โEUR,โ and amount as 10,000.
Then, once I click on the โConvertโ button, I get the below message to connect with my custom connector for additional data permission.
โAdditional permissions are required to run this action. To proceed, please select โConnectโ, and review any missing connections. Once you have made these updates, please select โRetryโ. You can also ask me anything else to go to a different topic.โ

Click on the โConnectโ button.
This will take you to your Copilot โManage connectionsโ page.

Select your connection, and click om the โConnectโ button. Then, create or pick a connection you need.

Click on the submit button. Now, I can see my connection has been successfully established.

Note:
- This is a one-time setup.
Now, letโs go back to my Copilot chatbot panel and click on the โRetryโ button, or you can start your fresh chat to convert your currency. Now, I can see my currency 10000 USD has been converted to EUR currency 8962.081699999999; this is a live conversion and correct as per current date and time.

Letโs verify this conversion with the Google system. Both the conversions look almost the same with a minor difference; that could be due to the sync of the backend system update.

YouTube Video Demo: How to Add and Call Custom Connector in Copilot Studio
Summary: Call Custom Connector in Copilot Studio to Convert Live Currency
Thus, in this article, we have learnt how to create a custom connector in Power Automate for currency conversion, how to add a custom connector in the Copilot topic as an action, how to design an adaptive card for the currency conversion app, how to call the custom currency conversion API connector in Copilot, and how to convert the currency from USD to EUR with live data.
I hope you enjoyed and liked this article and it helped you. Please consider subscribing to my site to get notifications for my future posts. ๐
ย
ย
About Post Author
Discover more from Global SharePoint
Subscribe to get the latest posts sent to your email.

