Forum Discussion
lParker755
Feb 02, 2023Copper Contributor
Run Query and List Results operation
I am using the Run Query and List Results operation within Logic Apps to get an Incident Name. The issue I have is it seems to be duplicating the results in the list i.e Incident Name appears twice....
Varun_Ghildiyal
Mar 10, 2023Iron Contributor
if the query is returning duplicate values for the Incident Name, one possible solution is to add a "distinct" operator to the query to ensure that only unique values are returned
SecurityIncidents
| where IncidentNumber == '<Incident Number>'
| distinct IncidentName
| project IncidentName
This query retrieves the unique IncidentName values for a given IncidentNumber. You can replace <Incident Number> with the actual incident number you want to query.
If you still encounter duplicate values, you can add a "take" operator to the query to limit the results to a single row. Here's an example query that includes both "distinct" and "take" operators: