Wednesday, December 25, 2024

Show all data of HTTP rest API request in Copilot agent

 Hello,

Suppose if you're making any HTTP call e.g. any API which is returning number of records then using Generative answers it will display summary of first 3 records. To overcome such situation follow below steps to show all records in UI.

  1. Make HTTP API call



  2. Parse response in another variable





  3. Create one new topic which has logic related to For Each. In that add logic to show record as per data. Make sure kind:Foreach in order to looping.

**{Topic.varListingRecord.name}**<br> Address: {Topic.varListingRecord.address1} {Topic.varListingRecord.address2} <br>{Topic.varListingRecord.city} {Topic.varListingRecord.province} {Topic.varListingRecord.country} {Topic.varListingRecord.postalZip}<br>Listing Type: {Topic.varListingRecord.listingType} <br>Timezone: {Topic.varListingRecord.timezone} <br>Currency: {Topic.varListingRecord.displayCurrency} {First(Topic.varListingRecord.rates).pricePerNight} <br> {Topic.varListingRecord.externalUrl} {Topic.varListingRecord.facebook} {Topic.varListingRecord.twitter} {Topic.varListingRecord.google} <br>{Topic.varListingRecord.propertyDescription}


  1. Will get output like this where it will display all data but here included only single record in snap.




Saturday, December 21, 2024

Pass variable/session/cookie data from website to CoPilot agent topic

Hello friends,

Here I'm sharing step by step information how can we pass any application variables e.g. cookie/session data from custom website to CoPilot agent topic.

Go to Conversation Start topic and add variable like below make sure to set variable properties Global > External sources can set values.


In this example I've integrated CoPilot agent in .Net core 8.0 web application. So in page where you're calling agent over there pass those variable values as Iframe querystring.

After it you can see able to access page variable values in CoPilot agent.