Email digest for Prospect Status blank notification

Options

In a Power Automate group meeting in February, I had some help in getting this to work. The end result was getting one email for each Constituent that has a blank Prospect Status.

I really need to get an email digest of everyone in the list who doesn't have a Prospect Status. I've rewatched the Bootcamp video #3, to better understand why my looping isn't working. Alas, that didn't clarify things for me.

Here is my flow chart of the process:

3be6a5d6553f1532129ed6ef99ed6621-huge-pr


Here are the steps in my flow so far:

7003cd6b94f47e8f62f41128ebe29d1d-huge-im

And then my Apply to Each steps are:

fb43bdec826c534909227d0717ebf248-huge-im


While “If no” is blank, I have a few steps under “If yes”:

e28aaf4763a8a995dea0ea183ef664e5-huge-im


Currently when this runs, the email returns only my email text, without any data:

The Prospect Status is missing from the following record(s):

[this is where I'd expect data]
Please refer to the Prospect Management tile to add the Status.

What am I doing wrong? Thanks in advance.

Comments

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Chris Zello
    The flow is flawed, so that's why you are having problem.

    If I have to read your flow as you have it it say:

    1. get a list of constituents
    2. for each constituent
      1. get propsect status
      2. condition on if prospect status is null
        1. if yes
          1. create html table based on the MissingStatus array variable (on FIRST constituent you are looping, the array variable would be “empty”, there's nothing to create HTML table for
          2. append to the MissingStatus array variable information about the constituent
          3. send an email, which in the body, you are likely adding the output from create html table, which will be empty

    So if you are just testing, and your “list constituent” only return ONE constituent (and that constituent has no prospect status), you will get ONE email and it will not have any constituent table

    if your “list constituent” has TWO constituents (and both do not have prospect status), then you will get TWO emails: ONE email with no constituent detail table; 2nd email with ONE constituent detail in table (the one from first constituent in list, and will not have the 2nd constituent row).

    To do what you want, this is the flow you need:

    1. get a list of constituents
    2. for each constituent
      1. get prospect status
      2. condition on if prospect status is null
        1. if yes
          1. append to the MissingStatus array variable information about the constituent
    3. condition on if length of MissingStatus (expression: length(variables('MissingStatus'))>0
      1. if yes
        1. create html table using MissingStatus
        2. send email with the output from create html table

    Read the flow carefully and try to determine how it differs from what you have. Then once you understand the logical progression of the flow, you can try to implement in flow's action.

  • @Chris Zello- Hi Chris- I went ahead and created a simple flow to see how it works. Here is what I did, I hope it helps. I know you've been struggling with this for a while.

    After your list constituents, you want to Get the Prospect Status which is below.

    2e8b852469c19ade95d6c5e2f628332b-huge-im

    Under the condition I have:

    length(coalesce(outputs('Get_constituent_prospect_status')?['body/status'],''))

    and note I have it “is equal to" 0

    Then I have simple variable string that will add “No Status” if it is equal to zero.

    If you click in the Condition about that has the length and go under “Configure run after” you want to check the failed box also.

    f9de53b1c86916c04a49b2b8cd507fed-huge-im

    Then outside of the loop above I added another condition which says If No Status= No Status then grab the constituent and build an array of information that can be added to a HTML table and emailed out. The Get a Constituent is pulling in the SystemID from the earlier List Constituents (hence the loop)

    a3d0611acc00c58ad0ea176658f4ee06-huge-im

    Here's the whole thing in one. I can zip this up and send it to you if you want to import it and update what you need to.

    606ea03f3fce47dcee4c540d18ad6ac2-huge-im


  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Carol Grant
    Get constituent prospect status action is not going to return error regardless of constituent have or doesn't have prospect status. So using “configure run after” on that action “fail” could be a problem as you are making the assumption that if the step failed, you are assuming prospect status is blank. (the error in the action to get prospect status could be b/c of rate limit of SKY API call)

    I also see a lot of flow that is looping through list of constituent (or list of gift) and then do a get a constituent again, not sure why this is a trend, but that's usually is not needed (this is good IF the constituent list api does not return some field that you plan to use that is returned by the single get constituent call, for example: requests_no_email).

    there seems to be a issue with your flow where you have the “Condition- If No Status Get Constituent”, where it is placed outside of the Apply to each-Get Prospect Status loop that loops through the constituents in the list returned. I think you might have just accidently dragged the action outside of the appy to each (since your screenshot of the configure run after appears to be in the correct location).

    The condition that Chris has is good, which condition on “Status” is null

  • @Alex Wong

    My flow does fail when there is no prospect status returned. So configuring to Run after even if failing is necessary.

    7dc3c1f05622621838a33abdf28f8b65-huge-im


  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Carol Grant
    I tried it on my record which has blank prospect status, and did get response succesfully, but that could mean my record may have been tested many times before and might had the status at one point and deleted later and somehow still got the data back.

    I would be hesitant to just do “configure run after” fail as fail can mean many things. YOu can have a parallel action that run when failed, and get the status code of fail. If 404, then meaning the constituent doesn't have status code so same as “blank” code. Anything else should be just normal error processing

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Carol Grant
    Actually dont' need the parallel action, do the configure run after success and fail for the get prospect action. in the condition use this:

    8956f18cc97c33ba18da2c35c6fb6aed-huge-im

    so basically, the expression is outputs('Get_constituent_prospect_status')?['statusCode'] which is getting the statuscode of the API call, when 404, OR when 200 and Status is null, constituent doesn't have prospect status.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Chris Zello
    I will use what you are trying to do as sample for my session in bbdevday: 6/6 Thursday session on Power Automate Tips and Tricks at 3PM-3:45PM EDT. If you signed up for bbdevday and is attending, you can come to the session to learn.

    https://blackbaud.swoogo.com/bbdevdays2024

    if you are not, I will see if I can get the video recording posted for you later on

  • @Alex Wong Yes, this sounds like a good example. Unfortunately I have a conflict and will have to watch the recording later.

    I've been working on this for so long that I'm not really sure the best route to take. I find it interesting that moving from the flow that sent an email for each record that was missing the Prospect Status, that moving to a digest email has different steps/logic. Thank you.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Chris Zello
    here's link to the on demand video

    If you are unable to access, @Erik Leaver maybe can help.

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 PowerUp Challenge #3 Gift Management Name Dropper

    @Chris Zello
    prospectdigest_20240607135719.zip

    this is the flow I created at the session yesterday, you can import and see. combine that with the session video (if/when you have access), you can learn more about the process of it.

  • @Alex Wong Thank you so much Alex! I was able to make the updates for my RE environment and get things to run. Still working out some hyperlink HREF tweaks for the output in the email, but otherwise it works great. I appreciate you creating this and sending the link to the video of your session. Really liked how you addressed the error handling too.

Categories