0 2 Workflow questions - age calculation and adding a note to a person 1 Michael Garrison posted 9 Years Ago I'm working on my first workflow- one that I'd like to be triggered when a person is added to the database. (Since it doesn't look like this is possible I'm settling for when their address is saved I mistook the filter options- right now it looks like it's going to run EVERY time someone is saved- I guess I'm going to have to add a check of RecordCreated). The idea is that a pastor needs to initiate contact with them. I'd like the workflow to be stopped and thrown out if they are not older than 18, so I've set up an Attribute called "Age" and created a "Set Attribute Value" action to set "Age" to {{ Person.Age }} ( {{ Context.Person.Age }} works in an HTML block if added to a profile page, and I'm assuming that Context isn't required here, based on some other examples). Then the next action checks and if the "Age" attribute is less than 18, it runs "Delete Workflow". Is that the right way to do that? Second, once contact is made, I'd like their "Resolution" notes to be saved as a "Note" in their person profile. But I don't see such an action available. Previously I've noticed that there is likewise no way to add such a note in "Batch Update" either- such an ability would be quite helpful! Is there a way to do this? Thanks
Michael Garrison 9 years ago No, I'm apparently not understanding how to use triggers so I can't get this to run at all. For the time being I created a page with a dynamic block simply listing in chronological order everyone added to the database since we went live and we are manually creating follow up tasks from that.
Michael Garrison 9 years ago It's really hard to tell. Something is still not working correctly, but I don't know what part. I have a trigger set toEntity: PersonType: Post-SaveWorkflow: Newly createdAnd I see several hundred "Newly Created" workflows that have apparently been triggered- most recently 5:10pm on 4/27. So it's firing sometimes. But the workflow is not doing what I expect- it should be assigning me a task for every new person added to the database. The log indicates that it's skipping the conditional "delete workflow" action (at least, there's no checkmark next to it), so I thought perhaps I wasn't setting up the condition correctly. So I went in to the workflow and added a "write to log" action with {{ Person.CreatedDateTime | DateDiff:'Now','m' }} (the lava code I've assigned to a workflow attribute which the conditional action checks) and saved the workflow. Then I edited my Admin profile (added a nick name) and checked the workflow- no new entry. I changed an Extended attribute and checked again- no new entry.So SOMETHING is causing it to fire, but whatever it is, is obviously not the trigger I want/expected. And when it does fire, it's running through all of the steps and immediately marking the workflow as "completed" which I'm sure is due to faulty workflow programming on my part.