cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-bacao-msft
Community Support
Community Support

 

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
Brad_Groux
Community Champion
Community Champion

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!

v-bacao-msft
Community Support
Community Support

 

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.

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,546)