cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AYCHL
Frequent Visitor

OData Filter SQL from Another SQL Query

Hi guys,

I'm able to get the records that I want to see if the Serial Exist in another database table.

I query the Table1 to get the records that are not Removed (Removed eq false).

But I want to compare the Table 1 filtered array with the Table2.AssetSerial.

Then Create an array with the Serials found that are in both Arrays and update the Table1 records.

 

e.i

 

Table1 Filtered

ID   AssetSerial   Removed

1    Serial-1         0

2    Serial-2         0 

3    Serial-3         0

4    Serial-4         0

Table2 Filtered based on Table 1 array

ID       AssetSerial   EntryDate

550    Serial-2         2020-01-09

621    Serial-3         2020-01-09

 

then update Table1's ID: 2 & 3 to Removed = true

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: OData Filter SQL from Another SQL Query

 

Hi @AYCHL ,

 

You could refer to the following methods to configure Flow.

  • First, initialize the array variable is used to store all AssetSerial in Table2.
  • Use the Get rows action to get the records in Table1 and iterate through all the records.
  • Determines whether the array variable contains the AssetSerial contained in the current record. If it does not, the record is updated.

Image reference:

14.PNG15.PNG

Hope this helps.

 

Best Regards,

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

View solution in original post

3 REPLIES 3
Super User
Super User

Re: OData Filter SQL from Another SQL Query

If you could provide an expanded screenshot of your Flow and steps, and of any detailed error messages you're receiving we could likely better assist you. Also, for the best results, you may want to review How to write a good forum post.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support
Community Support

Re: OData Filter SQL from Another SQL Query

 

Hi @AYCHL ,

 

You could refer to the following methods to configure Flow.

  • First, initialize the array variable is used to store all AssetSerial in Table2.
  • Use the Get rows action to get the records in Table1 and iterate through all the records.
  • Determines whether the array variable contains the AssetSerial contained in the current record. If it does not, the record is updated.

Image reference:

14.PNG15.PNG

Hope this helps.

 

Best Regards,

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

View solution in original post

AYCHL
Frequent Visitor

Re: OData Filter SQL from Another SQL Query

Thank you @v-bacao-msft  for the Help!

While this was great help, I was able to do it differently!

1.JPG2.JPG3.JPG

 

I Still think there is a more efficient way to do this, I will try your Method and see how it works!

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,774)