Hi,
I faced something similar earlier. The issue usually comes when we open the app from an email link (href), the URL contains parameters, but when we navigate to another page inside the app, the URL doesn’t get updated properly. Because of that, the JavaScript which reads parameters from the URL keeps picking the old values and creates unexpected behavior.
What you can do here is reset the URL once the page is loaded, so those old parameters don’t interfere anymore. You can handle this using a small JavaScript:
window.history.replaceState({}, document.title, window.location.pathname);
This will clean the URL and bring it back to the default path without reloading the page.
Also, one more thing you can do is—if you are using URL parameters, just read them once (on page load), store them in an object or variable, and then avoid reading again from the URL during further navigation.
If you are dealing with email links frequently, using the Deep Link module is also a better approach, as it handles these scenarios in a more structured way.
Hope this helps !
Hi Bo Sung Kim
HAA this is a common issue when using deep links or URL parameters in Mendix. Here are the step which you need to follow to fix
1. Use the Mendix Deep Link Module
If you're using URL parameters, make sure you're using the Deep Link Module properly:
2. Clear Parameters via a JavaScript Action (Nanoflow)
Create a JavaScript Action that resets the URL after the parameter is consumed:
javascript
// Replace current history entry with the clean base URL
window.history.replaceState({}, document.title, window.location.pathname);
Call this nanoflow immediately after you've extracted and stored the URL parameter in a Mendix variable before any page navigation occurs.
3. Use window.history.pushState on Page Load
In a HTML Snippet or JS Action triggered on page load of the destination page:
javascript
// Runs on the new page load — wipes out any leftover query string
if (window.location.search) {
window.history.replaceState(null, '', window.location.pathname);
}
This ensures that even if the URL carries over, it gets cleaned on arrival.
4. Store the Parameter Before Navigation (Best Practice)
The most robust pattern is:
$currentUser attributeThis way, your JS never sees a stale URL because it never reads from the URL on the target page at all.
I hope this helps you. Let me kow If you need anymore help
You can use a widget such as Set Url React on the page to change the URL shown to the user. when the page renders. You will need to use this in conjunction with Page and Microflow URLs if you want the links to work if a user bookmarks the page.
https://marketplace.mendix.com/link/component/120500
I hope this helps.
Hi,
This is expected behavior in Mendix because it is a SPA (Single Page Application). When navigating between pages, the URL (including query parameters) is not automatically cleared.
To reset the URL, you need to handle it explicitly.
1. Use Deeplink navigation (recommended)
If your page is opened via URL parameters, use the Deeplink module and navigate using clean URLs (without unwanted params).
This ensures each navigation starts with a fresh URL.
2. Clear URL parameters using JavaScript (client-side)
You can remove query parameters on page load using a small JS action:
window.history.replaceState({}, document.title, window.location.pathname);
Call this in a nanoflow on page load.
This resets the URL without reloading the page.
3. Avoid relying directly on URL parameters after initial load
Best practice in Mendix:
4. Use “Open Page” instead of URL navigation
When navigating internally, always use Mendix page navigation (microflow/nanoflow).
This avoids carrying over unwanted query parameters.
Mendix does not automatically reset URLs during navigation. The recommended solution is to either clean the URL using history.replaceState or handle parameters once and store them in the app state, rather than relying on persistent query parameters.