Volunteers- Find Deceased and Compare Dates

Options

I want to do a flow that looks to see if a Volunteer is deceased so they can remove the Volunteer code. The code is under Custom Fields.

Limitations: I only want the ones that have been deceased in the last 90 days. There are a little over 5k coded. (List Constituents have a limit of 5k)

In the List Constituents I have the Custom Field Category and Date Modified limits. Is there any other way to limit List Constituents by deceased date?

Then I filter the array with Deceased Day is not equal to null

Now I want to see if the Deceased Date is greater than today-90 days.

I have this in a Compose:

formatDateTime(addDays(utcNow(), -90), 'yyyy-MM-dd')

Then I'm not sure how to get the Deceased Date into the correct format because it's split out into integers the Get a Constituent. I tried concatenate:

concat(outputs('Get_a_constituent-_All_Deceased')?['body/deceased_date/m'],'/',outputs('Get_a_constituent-_All_Deceased')?['body/deceased_date/d'],'/',outputs('Get_a_constituent-_All_Deceased')?['body/deceased_date/y'])

Then I have another Compose

formatDateTime(outputs('Compose-_Deceased_Date'),'yyyy-MM-dd')

Then I try to compare and it doesn't work.

I'm also tried doing ticks but then I say in a Condition if the Final Difference is greater than 90 it says it's not an integer.

701ec2f21cf2f3abc7af5e0a4b598aa2-huge-im

Comments

  • @Carolyn Grant
    Yes, fuzzy dates can be a challenge to work with.

    Can you give a little more info on what happens when you run this? Where is it breaking down, and are you getting any error messages?

  • @Ben Regier- Hi Ben- come to find out it wasn't an issue with the date format. I was getting this error in the Append to String so I thought it was the date but in reality it was because the person didn't have a deceased date at all.

    Unable to process template language expressions in action 'Append_to_string_variable' inputs at line '0' and column '0': 'In function 'formatDateTime', the value provided for date time string '//' was not valid. The datetime string must match ISO 8601 format.'.

    I ended up changing my filter for the filter array to Deceased Year is not equal to null instead of day and it works!

    I did notice another problem with using Past Time which I'll post on another topic.

Categories