0
votes

I run this simple query in Logic App using the "Execute a SQL query (V2)" connector to find out if a number exists in my table.

select count(*) from users where user_number='724-555-5555';

If the number exist, I get this JSON , but somehow I cant parse it.

[
  {
    "": 1
  }
]

Any idea how to simply retrieve 0 or 1 ? Thanks David

1
Does the user_number column have a UNIQUE constraint or index? - Dai

1 Answers

2
votes

You need to add an explicit column name:

SELECT
    count(*) AS cnt
FROM
    users
WHERE
    user_number = '724-555-5555';

That will give you this result:

[ { "cnt": 1 } ]

...which is valid JSON.