Power Automate: Issue when Condition returns no results - not going to False arm, just skipping

Options
7ca2c85dbf1d9fcc18c239cc4708b196-huge-ca

I'm building a Power Automate flow that gets response data from a MS Form, searches for a RENXT constituent record with matching email address and if no match, then it does a set of actions, and if it has 1 match on 1 record, it adds a Participant record for a specific event. I first built the flow with the condition of if the count of records that match equals 1 (TRUE), add participant record, and (after a bit of trial and error) it worked, yay! Where I am having a problem is if I test with an email address that doesn't exist in RE, aka what I thought of as FALSE, the flow test run is saying it is successful but instead of executing the actions on the FALSE side, it is saying it skipped because "there are no items to repeat." We tried switching it around so that the first condition is Greater than 0, the True side goes through actions that deal with if there is a match, so the False side is obviously if it equals 0, but that had the same resulting status as above - skipped! We think it has to do with having a null result and not knowing what to do about it. Has anyone overcome this challenge before? Where if the result is 0 to do an action?

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary 1,500 Likes 2500 Comments Name Dropper

    @Amanda Mogridge
    which search did you use? please show edit mode screenshot of the search action and in run history. (since you mention something about a “count” i'm guessing you are using “Search for a constituent” action). Also please provide screenshot of your condition as well.

    I just did a test on both:

    cfb88e833ba2c22ddfa8767e95a6410f-huge-im
    c6cc05bf5fdb1ed829f5197fdf91def6-huge-im
    9502b1a921ef0b9783c38cf79a881c29-huge-im
    598a7ae27c9d41e1dced52d724373940-huge-im
    edit mode

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

    length(outputs('Search_for_a_constituent_(enhanced)')?['body/results'])

    If you are using the “normal” search, then you can use the Count dynamic content, if you use enhanced, you can use the expression above to get “length” of how many constituent matched for condition.

    You should be able to simply do 2 condition to deal with this:

    3a642b4b2d740766a3ec8ed6dc1d8586-huge-im
    8b221197774c5100591332610dd7b520-huge-im
    ac0adb3e755252970ba8900ddda95480-huge-im

Categories