cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
Super User II
Super User II

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!

Highlighted
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

Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,383)