[SalesForce] Return to originating view from List Button in Lightning Experience

I have a VF page containing a flow. The VF page uses a Standard List Controller pass a list of records (Contacts) to the flow. I've added a List Button and added it to the List layout, and this works. But I need to change the end of flow behavior. According to the docs, you can specify a finishLocation on the flow in VF to specify where the User ends up after the flow.

The client would like to send the user back to the original list view (whichever view was selected) after the flow. Is this possible? I added a controller extension to check the referer header (ApexPages.currentPage().getHeaders().get('Referer')), but that is only returning a base URL (e.g., https://force-drive-3563.lightning.force.com/) in LEX. Just redirecting to the LEX generic list view url (/lightning/o/Contact/list) without specifying filterName always displays "recently viewed" contacts. Is there any way to determine the originating view and to send the user back to it after the flow?

Best Answer

I haven't tried this but theoretically looking at the documentation looks like you could achieve what your'e looking for Using Standard List Controller Actions

list : Returns a PageReference object of the standard list page, based on the most recently used list filter for that object when the filterId is not specified by the user.

For reference: The CORRECT way to redirect to a ListView from StandardSetController?