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.