In Copilot I am using http request and getting the values from API. And the response is in the following format:
[
{
"TicketNumber": "XYZ9876543210",
"FlightStatus": "Scheduled",
"Departure": "Chennai",
"DepartureTime": "2024-03-18T06:30:15.932Z",
"Arrival": "Trichy",
"ArrivalTime": "2024-03-18T09:30:15.951Z",
"AirlineName": "IndiGo",
"ClassOfService": "Economy"
},
{
"TicketNumber": "ABC1234567890",
"FlightStatus": "Scheduled",
"Departure": "Chennai",
"DepartureTime": "2024-03-18T07:30:42.231Z",
"Arrival": "Trichy",
"ArrivalTime": "2024-03-18T10:00:42.258Z",
"AirlineName": "IndiGo",
"ClassOfService": "Economy"
}
]
Now I have stored this response to a variable of Table type.
Initially I was getting this error- Error Message: Missing or invalid assignment for variable ‘searchResult.Content’.
Then I tried as you've mentioned above with below formula -
ForAll(Topic.FlightDetails,
{
Content: TicketNumber & " - with Status " & FlightStatus ,
ContentLocation: Blank()
}
)
(Note: I am using this formula in the data source of Generative answers. Correct me if that's wrong.)
Here, TicketNumber and FlightStatus are the fields from the json provided above.
On doing this, I am getting below error-
Name isn't valid. 'TicketNumber' isn't recognized.
Name isn't valid. 'FlightStatus' isn't recognized.
Please help me on this!