Run Query and List Results operation

Copper Contributor

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.  Is there some setting I'm missing or is there a concise way to strip the second value away?  

1 Reply

@lParker755 

 

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: