You feed the body of the inbound message into the HTML To Text action to get just the text, then use the following expression to format the name by Last, First
concat(split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[1],', ',split(substring(body('Html_to_text'),add(indexOf(body('Html_to_text'),'Due date:'),24),sub(indexOf(body('Html_to_text'),'has an overdue'),add(indexOf(body('Html_to_text'),'Due date:'),25))),' ')[0])
That expression is a lot, but try it out. Here it is broken out and formatted nicer:
concat(
split(
substring(
body('Html_to_text'),
add(
indexOf(
body('Html_to_text'),
'Due date:'
),
24
),
sub(
indexOf(
body('Html_to_text'),
'has an overdue'
),
add(
indexOf(
body('Html_to_text'),
'Due date:'
),
25
)
)
),
' '
)[1],
', ',
split(
substring(
body('Html_to_text'),
add(
indexOf(
body('Html_to_text'),
'Due date:'
),
24
),
sub(
indexOf(
body('Html_to_text'),
'has an overdue'
),
add(
indexOf(
body('Html_to_text'),
'Due date:'
),
25
)
)
),
' '
)[0],
)
In the output of the Search For Users action, you'll have the Mail attribute (if the search was successful) and can use that.