Refer to selected parent entity in UI action

I have data structure “Course” with hierarchic structure: Course → Lesson → Question → Answer.
In application I select course, then one of it’s lessons, then one of the lesson’s questions. Then I go to answer section, and I want to call a stored procedure via UI action which creates the answer in that selected question (I don’t want to use “+” sign).
How can I hand the selected question id (or selected lesson id) as a parameter to sequential workflow? When I pass whole structure, there are all data for one specific course, so I know the course id, but there are all lessons and all theirs questions. How can I distinguish, which lesson and which question is selected?

I’d add an action button Answer to the section/level Question. Then you have access to QuestionId.

Yes that’s one workaround, in some cases it’s applicable, in some cases it’s not so ideal - when I want to add new question to lesson, I’d had to put it to lesson section, but there I don’t see all the questions, so it’s not so transparent for user. But it works somehow, thanks for the tip.

So I get it that currently there’s no way of reliably getting selected parent id? The I’d suggest to add some attribute to XML, which will tell this. There’s already attribute selected, which I think has another meaning (checked by checkbox), so it’d had to have another name. I think technically it should be no problem, as Origam must already know this id for “+” sign to work, right?

The current row has always a column pointing to its parent. Are you looking for a parent-parent?

How do you pass the data to the workflow? Using a dot . you can pass the current record and all its parents and children (but not its siblings). Wouldn’t that be the solution?