0 Auto-filling person attribute in "Action" menu triggered workflow 3 Michael Garrison posted 9 Years Ago I'm creating a rather all-purpose workflow to allow a person to be added to the "task" list of staff members in order to request follow-up contact to be made. I've gotten everything working when triggered through the "Workflows" page and I've added this workflow to the "Actions" menu on the person profile pages. And while it's ok, it would be ideal if the "Person" attribute (the person to be followed up with) could be auto-populated with the person from whose profile the workflow was begun. If I look at other similar workflows (Data Error, for example), they include a "Set Person" action, which is set to "Set Attribute to Entity", the Attribute being set to "Person". I'm assuming that this is where that information gets automatically set. (the only other pertinent item I can see in the documentation is the "Activate Workflow" block which I don't think is right for this - it appears that if I add that to the person profile page it tries to activate the workflow immediately - I'd probably have to make a sub-page with a button linking to it) But if I add this same action to the top of my own workflow, the "Person" attribute still does not auto-populate on the data collection form, and what's more when I submit the form I get an error: Error in Activity: Request; Action: Set Person (Set Attribute To Entity action type) The entity is null or not a Rock IEntity. I don't know what that means- the only thing I can think is that it's being called upon the form submission for some reason, which is AFTER the personid URL parameter has already been cleared, so there IS no person attribute to read. But unless I'm mistaken, this should have already happened since my actions are "Set Person", THEN "Prompt User".
Michael Garrison 9 years ago OK, that works ... but my concern is that I didn't want to persist the workflow until AFTER the data was requested from the user, in case they cancel it at that point (similar to the reason it's not persisted until that point on the public webpage contact form). I suppose the right way to do it is to offer a "Cancel" button that triggers a "delete" activity...?Edit: Such a cancel button doesn't work, since I have form elements marked as "required" =/
Michael Garrison 9 years ago One other thing, if I do that, they can't trigger it from "Tools -> Workflows" or I get the same "Entity is null or not a Rock IEntity" error. Probably a minor thing to hide it from there and force them to trigger it from a profile, but is there a way to check if the parameter exists and only conditionally run the "Set Attribute To Entity" action if it does?
Michael Garrison 9 years ago Seems brilliant, the question that came to mind was what happens when one of the two (really three, but one's in a delay) activities that launch at start has an error? So I tried it out- I set up my workflow like you described and launched it from the "Tools > Workflows" menu. Sure enough, no auto-complete, no error. So I filled out the request and submitted it. Oops! Now I get the error:Workflow Processing Error(s): •Error in Activity: Auto-fill the person; Action: Auto-fill Person (Set Attribute To Entity action type)•The entity is null or not a Rock IEntity.So while I was hoping that an error in one activity would be ignored if there were others running (or queued, as I guess the situation is), the error instead stops the entire workflow- I see that neither workflow persist action executed, as the workflow does not appear in the "Manage" menu for that task.Edit: And do I need to add another 1 minute delay to Third Activity set to complete the activity upon completion? Because it looks like "Delete Blank Request" stays active when the task is launched from a profile (or at least listed under "Activities" in the management window) even after 10 minutes have elapsed and theoretically it shouldn't be there any more. Would that work that way? I'm assuming that selecting that attribute on the "Delete Workflow" action would have no effect if the filter kept the action from running...
Michael Garrison 9 years ago Hopefully the delay fix will address the errors that occurred once I had that element in my workflow- thanks! To the rest...BRILLIANT! ;) Appreciate it.