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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to check for emtpy...
Power Automate
Unanswered

How to check for emtpy collection or for existence of data row in Common Data Model database

(0) ShareShare
ReportReport
Posted on by 18

Hi,

 

I need to verify if a row with certain ID exists in the table, if yes - run one command chain, if no - insert the new value and run another command chain.

 

I do the Get entity data with a filter, but then if I try to add a condition, it automatically changes to "apply to each", and tries to iterate over "values", comparing the value to null does not work (it is always not null), trying to compare some column within the row to be returned does not work - both yes/no options are skipped.

 

Any ideas?

Categories:
  • RajRa Profile Picture
    Microsoft Employee on at

    Hi SentiNode,

     

    You have to use the advanced mode in the condition expression and use the @empty Logic app expression https://aka.ms/logicexpressions 

     

    Here's a flow that demonstrate it - be sure to click on the advanced mode in the filter array to enter this value

     

    photo.PNG

  • SentiNode Profile Picture
    18 on at

    Actually I would like to do :

    Get Entity Data (with a correct filter) ------>  Condition  [Yes block | No block].
     
    How should I properly use @empty to verify if Get Entity Data returns an empty collection or an actual object?

     

    The Filter Array -> Apply to each, wouldnt be the best solution here:

     

    1)  I will get either a single result (the object exists in a table) or no results (the object does not exist in a table)

     

    2) I it does not exist - I want to create it, if it does exist however - I want to update it and increase update counter in the object.

  • RajRa Profile Picture
    Microsoft Employee on at

    You should be also able to use the empty expression in a condition card (without the filter array) and detect if the object exists or not - Go into the advanced mode.

     

    Let us know if this adresses it.

  • SentiNode Profile Picture
    18 on at

    I did, but it goes one way always (empty) regardless of the actual array

  • RajRa Profile Picture
    Microsoft Employee on at

    Hi SentiNode,

     

    To be clear, your flow should look like so, fill in the Yes/No paths to do what you want. This does not work?

     

    pic.PNG

  • SentiNode Profile Picture
    18 on at

    Id do not have "apply to each" box, can I check directly the results of Get Entity Data if there were some results??

  • RajRa Profile Picture
    Microsoft Employee on at

    Unfortunately, GetEntity data does not support a filter today.

     

    Can you clarify what you mean by "do not have "apply to each" box?

     

  • SentiNode Profile Picture
    18 on at

    Hmm, why can I set a filter in GetEntity then?

    Directly after get entity I have the condition, not using "apply to each" to encircle it.

     

    flow.png

  • RajRa Profile Picture
    Microsoft Employee on at

    Can you replace GetEntity by GetList of Entities, post that you should be able to apply the foreach like how I listed.

  • SentiNode Profile Picture
    18 on at
    Get entity data returns the list on the matching entities... is there any debug to see the data structures that are actually passed? Maybe it returns an array of array objects?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard