web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check if record exists...
Power Apps
Answered

Check if record exists in Dataverse from a MySQL DB

(0) ShareShare
ReportReport
Posted on by 21

Hi There. I have a MySQL DB with a `Countries` table where I need to make sure that the same data exists in Dataverse.
I have build a simple flow to pull the data from MySQL, loop over every record and make a lookup with Dataverse.

But I get the following error and I am not to sure where it goes wrong?

Screenshot 2021-11-12 at 09.40.35.png

 

The entire flow look like this:
Screenshot 2021-11-12 at 09.35.40.png

 

 

I have the same question (0)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Rocky_Dev,

     

    Points to be Noted.

     

    rampprakash_0-1636708899346.png

    You are passing Country ID here as ROW ID, Country ID is UniqueIdentifier in DataVerse, and am not sure how it will be in SQL. hence you got the error.

     

    Suggesstion:

     

    Use List Rows to Countries in DataVerse Flows then use filter countryname eq 'CountryNameFromSQL'

     

    then check If Condition in Flows with 

     

    @length(body('Get_rows')?['value'])  equals Zero(0)

     

    then Create else do your operation

     

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

  • DuckyDev_IU Profile Picture
    21 on at

    This almost works!
    However in myql I have the following data

     

    CountryIDCountry
    1United Kingdom
    2Denmark
    3Non Inland UK
    4Sweeden

     

    And in Dataverse I got:

     

    iu_integration_keyCountry
    1United Kingdom
    2Denmark

     

    And as you said(almost),

    1. Get List Rows to Countries in Dataverse
    2. Get List Rows to Countries from Mysql
      1. Filter with `iu_integration_key ne CountryID`

    But for some reason is `Denmark` duplicated in the outut

    [
     {
    
     "CountryID": 2,
     "Country": "Denmark",
     "CurrencyID": 3,
    
     },
     {
    
     "CountryID": 3,
     "Country": "Non Inland UK",
     "CurrencyID": 1,
     
     },
     {
    
     "CountryID": 4,
     "Country": "Sweden",
     "CurrencyID": 4,
     
     }
    ]
  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Rocky_Dev,

     

    Thats strange, i tried from my end and its working as expected

     

    rampprakash_0-1636718436240.png

     

     

    rampprakash_1-1636718453173.png

     

     

    Query in if Condition : 

    length(outputs('List_rows_2')?['body/value'])
     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     
  • DuckyDev_IU Profile Picture
    21 on at

    I might think I made an error, sry! You initial thought was correct.

    But I am having trouble convering the `CountryID` from the external database to a string:
    ```
    A binary operator with incompatible types was detected. Found operand types 'Edm.Int32' and 'Edm.String' for operator kind 'Equal'.
    ```

  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @Rocky_Dev,

     

    Simple try  using ' ' (Quotes in Country ID)

     

    iu_integration_key ne 'CountryID'

     

    rampprakash_0-1636722575271.png

     

     

    Thats it 🙂

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard