Get the current page name

1
How can I get the current page name in a Microflow? Can I do it with a Java action?
asked
3 answers
1

Hi Martin,

Have you seen this question?

https://forum.mendix.com/link/questions/89253

Ronald's answer suggests to create a microflow for every page that creates a string variable with the page name and passes it to a sub microflow that will run the logic for the help text. 

 

Another way to do this is with javascript. You could create a non-persistent object with an attribute for page name, and in your script, create the object, set the value based on the page name and then execute a microflow with this object as a parameter.

answered
1

As far as I know: Not at all.

This information is not passed to the server. What is your use case?

answered
0

you can use below code within javascript snippet and use it with nanoflow to get current page name:

var x = mx.ui.getContentForm().path;
var y = x.split('/');
var z = y[1].split('.');
var pageName =  z[0];
return pageName;

Note:

you can test this code directly from browser console.

answered