question

DeepakMandala-6835 avatar image
0 Votes"
DeepakMandala-6835 asked MayankBargali-MSFT commented

Filter Query in Azure logic App

Hi Team

Can someone help me how to filter the data from sql server while fetching using azure logic app and also i need to filter the data HTTP request payload column value

Example : payload example:
{
"tablename": "A"
}

Need to filter data from server using payload table name

azure-logic-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT commented

Hi @DeepakMandala-6835

Welcome to Microsoft Q&A! Thanks for posting the question.

You can use the Get rows (v2) action for SQL Server connector which has the Filter Query parameter that you can specify as per your need.
Please refer to Get rows (V2) action Aggregation transformation parameter detail for the usage.

Can you provide more details on this "i need to filter the data HTTP request payload column value". Do you mean once you have the data from Get rows you need to only return the rows rather than the dynamic content return by the Get rows (v2) action. If this is the case then on the next action of your workflow you can use any of the dynamic value that is return from your previous action.

Update: 7/27

Request Header while calling the logic app HTTP Post URL that is generated:

 Content-Length: 22
 Content-Type: application/json; charset=utf-8

Request Body:

 {
     "tablename": "A"
 }

The flow will be : When a HTTP request is received --> Parse JSON (use Body output of your previous action) --> Get rows (V2) (each parameter on your input request body from your previous action can now be used as parameter in any of your action.)
Please click on "Use sample payload to generate schema" and define the JSON payload that you are expecting so the request body JSON schema is created for you in both "When a HTTP request is received" and "Parse JSON" method

For your reference I am attaching the Code View

118187-image.png

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


codeview.txt (2.4 KiB)
image.png (39.8 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Mayank

Ii'm passing table name from http request payload as trigger body and i want to fetch records from sql server table for that table.

i would like to use below table name in filter query can u pls let me know how can i achieve this

Example : payload example:
{
"tablename": "A"
}
Thanks
Deepak

0 Votes 0 ·

@DeepakMandala-6835 I have updated my answer. Please let me know if you need any assistance.

0 Votes 0 ·