cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShivaPatpi
Microsoft
Microsoft

How to remove duplicates from the column values returned from SQL and extract a specific values from jsonparse output

After running the SQL query (Odata query) i got below results

body":{"@odata.context":"https://firstrelease-001.azure-apim.net/apim/sql/a088665dc8a549a08cb59b31978175ee/$metadata#datasets..."}

 

1) How to get only 1 X (it seems Odata query does not allow distinct in select list)

2) what options i have to get only X, Y values

3) I tried using ParseJSON i got the output like this

 

{
    "@odata.etag": "",
    "ItemInternalId": "738fa31c-2f04-43c9-9c98-8bd343704f94",
    "Region": "X"
  },
  {
    "@odata.etag": "",
    "ItemInternalId": "ff6735df-92eb-4634-803a-264b9606d571",
    "Region": "X"
  },
  {
    "@odata.etag": "",
    "ItemInternalId": "b2d9ea47-5e82-4507-8825-c84b9984be48",
    "Region": "Y"
  },
what will be my next step only to exat X & Y.
Please help out.
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ShivaPatpi 

I believe input of the "Apply to each" action is "Body" so If you add a compose action in "Apply to each" with the following expression:
items('Apply_to_each')['Region'] , what results are you getting?

 

PAJson.PNG

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
DeepakS
Super User
Super User

HI @ShivaPatpi 

If you are able to extract the result as JSON array , you can easily loop through the output and extract "Region"

something like : 

items('Apply_to_each')['Region'
 
If you could share a screen capture of Power Automate that will help though.
 
——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Here is the screen shot

 

 

 

Capture.PNG

Hi @ShivaPatpi 

I believe input of the "Apply to each" action is "Body" so If you add a compose action in "Apply to each" with the following expression:
items('Apply_to_each')['Region'] , what results are you getting?

 

PAJson.PNG

 

——————————————————
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,291)