cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Syntax for GetRows

Hi everyone,

 

I'm new to the community and have just started using Flows. Really cool possibilites but I need a little help. We use MS SQL on prem and I am trying to filter a GetRows action using a standard Select statement: 

 

SELECT
[Patient ID]
FROM [AthenaDataWarehouseFeed].[dbo].[patientinsurance]
WHERE ([Expiration Date] IS NULL OR [Expiration Date] = '')

 

When I try this, I get an error as follows:

 

Manage your flows | Microsoft Flow

{ "status": 400, "message": "Term 'SELECT [Patient ID]FROM [AthenaDataWarehouseFeed].[dbo].[patientinsurance]WHERE ([Expiration Date] IS NULL OR [Expiration Date] = '')' is not valid in a $select or $expand expression.\r\n inner exception: Term 'SELECT [Patient ID]FROM [AthenaDataWarehouseFeed].[dbo].[patientinsurance]WHERE ([Expiration Date] IS NULL OR [Expiration Date] = '')' is not valid in a $select or $expand expression.", "source": "127.0.0.1" }
 
I have been able to use SQL actions successfully in Flows to move information between Sharepoint and SQL Server without any problems up until now when I am trying to limit the GetRows return result. I can't find any real documentation for Flow regarding the use of different Action types or syntax. Any help would be greatly appreciated.
 
Regards,
 
Stewart
3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Syntax for GetRows

Hi @sbarre,

 

Could you please share about where you put the select sentence ?

 

If you are using the SQL Server Get Rows:

2.PNG

The Select Query and the Filter query part, works only with the OData query parameter, it can't be used to execute the SQL language.

Basic Tutorial

For the Null value with the Expiration Date, I am afraid currently it is not working.

As the NULL value can't be recognized under Microsoft Flow, also the '' not work as well.

In addition, Column name with sapce should be write in the format below:

Expiration_x0020_Date

Use the _x0020_ to replace the Space.

For the Select query, just use the column name, then seperate them with comma.

3.PNG

If you have any further questions, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate II
Advocate II

Re: Syntax for GetRows

Hello,

 

I am trying to achieve something similar. I am collecting use email from Microsoft form and then want to extract manager's email id for that user from Azure DB to send approval request. I've a table UserDetails which contains UserName, Email and ManagerName. Once I extract ManagerName for the user, I can get his email id from the same table(self join). I am not sure how to implement self join in flow. Looking for other suggestions as well.

 

Thank you!

Highlighted
Advocate I
Advocate I

Re: Syntax for GetRows

How do you add a where clause to this? I am using SQL on Prem

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,406)