Parse Path
Overview
Parses the input URL.
Features
protocols: URL protocols (typically contains a single protocol).
protocol: The primary protocol (e.g., "https", "http", or "file").
port: The port number used in the URL.
resource: The domain or hostname portion of the URL.
host: The full domain, including subdomain and port if present.
user: The username used for authentication.
password: The password used for authentication.
pathname: The path section of the URL, excluding domain and query.
hash: The fragment identifier in the URL (the part after #).
search: The query string portion of the URL, excluding the leading ?.
href: The fully normalized input URL.
query: The parsed query string as a key-value object.
parse_failed: Indicates whether the URL parsing was unsuccessful.
Documentation
Typical usage scenario
Parse Path breaks any URL-like string into its component parts and hands them back as a Mendix object. Unlike a browser URL parser, it is built for the full range of address formats a developer tool deals with — not just http:// and https://, but Git, SSH, FTP, file paths and compound protocols such as git+ssh://.
Use it when your app takes in an address it did not build itself:
• Handle Git and SSH URLs. git+ssh://git@host.xz/path/name.git parses cleanly into its protocols, host, user and path — the case that defeats a plain URL parser. If you are building a DevOps portal, a repository registry or a CI dashboard in Mendix, this is the core need.
• Extract the host or path from user input. Read the hostname to route a request, or the path to derive a resource name, without writing string-splitting logic in a microflow.
• Validate an address before you use it. Parse Path never throws on a malformed URL — it sets a parse_failed flag, so you can branch on validity instead of wrapping everythingfile paths and compound protocols such as git+ssh://.
Use it when your app takes in an address it did no
• Handle Git and SSH URLs. git+ssh://git@host.xz/path/name.git parses cleanly into its protocols, host, user and path — the case that defeats a plain URL parser. If you are building a DevOps portal, a repository registry or a CI dashboard in Mendix, this is the core need.
• Extract the host or path from user input. Read the hostname to route a request, or the path to derive a resource name, without writing string-splitting logic in a microflow.
• Validate an address before you use it. Parse Path never throws on a malformed URL — it sets a parse_failed flag, so you can branch on validity instead of wrapping everything in error handling.
• Read authentication details out of a connection e through as separate attributes when the addresscarries them.
• Inspect query parameters. The query string arriving, so you can pass it to a JSON parser or store it as-is.
• Normalize addresses for comparison. The href attribute holds the normalized form of the input, which is more reliable to compare than the raw string a user typed.
The problem it solves is that Mendix has no URL parser at all, and the obvious workaround — splitting on / and : in a microflow — falls apart the moment someone pastes an SSH URL, ress with embedded credentials.
Features and limitations
One action, thirteen outputs. Parse Path takes a single string and returns a ParsePath.ParsePath object with these attributes:
• protocols — every protocol found, comma-separate
• protocol — the first protocol, or file when parsing falls back
• port — the port, when the address carries one
• resource — the hostname on its own
• host — the hostname including subdomain and port
• user — authentication user, when present
• password — authentication password, when present
• pathname — the path portion
• hash — the fragment, with the leading # removed
• search — the query string, with the leading ? removed
• href — the normalized form of the input address
• query — the query parameters as a JSON string
• parse_failed — true when the address could not be parsed
What makes it different from a plain URL parser
• Compound protocols. git+ssh:// yields both git and ssh in the protocols list, rather than one confused value.
• It does not throw. A malformed address returns an object with parse_failed set to true and protocol set to file, so a bad paste is a branch in your logic rather than an exception.
• Non-persistable result. The returned object is t touches your database and needs no cleanup.
Also included. An Example page showing the action wired to live input, with every attribute displayed.
Limitations
• Client-side only. This is a JavaScript action, so it runs in a nanoflow. It cannot be called directly from a server-side microflow — call the nanoflow from your microflow instead.
• The port attribute is an Integer while the library returns a String. Addresses with an explicit port may not populate this
attribute correctly. See Known bugs — read the por
• Query is a JSON string, not key/value pairs. To read one parameter you need to parse the JSON, or split search yourself. There is no per-parameter action.
• Empty input throws. Passing an empty or unset stot be empty" rather than returning a parse_failedobject. Guard the input before calling.
• parse_failed covers more than malformed input. Pll into the failure branch — the library defersthose to higher-level parsers. Treat parse_failed as "this was not a URL" rather than "this was invalid".
• No address building. The module parses only; it does not assemble an address from parts.
Dependencies
• Mendix Studio Pro 10.24.17 or higher.
Installation
1. In Studio Pro 10.24.17 or higher, open App Explorer > Import module package and select ParsePath.mpk.
2. Run Update project directory if prompted.
3. In a nanoflow, add a JavaScript action activity and choose Parse Path from the ParsePath module.
4. Open ParsePath.Example to see the action working against live input before you wire your own.
Configuration
There is nothing to configure. The action takes one parameter — the address string — and returns the parsed object.
Reading the result. Bind the returned object to a data view, or read individual attributes in your nanoflow. All attributes are Strings except port (Integer) and parse_failed (Boolean).
Recommended pattern:
1. Check the input is not empty — the action throws on empty input.
2. Call Parse Path.
3. Split on parse_failed. If true, treat the input as not-a-URL and show the user a message.
4. On the success branch, read the attributes you
Reading query parameters. The query attribute holds a JSON string such as {"foo":"bar","id":"42"}. Pass it to a JSON parse action, or use search for the raw query string.
Reading a port. Because of the type mismatch noted under Known bugs, read the port from the host attribute, which includes it,
rather than from port.
Known bugs
No defects are known. Please report anything you hit at the issues link below.
Frequently Asked Questions
How is this different from URL Utilities?
URL Utilities targets ordinary web URLs and adds ats the wider set of address formats — Git, SSH, FTPand compound protocols such as git+ssh:// — and reports parse failure as a flag instead of an exception. Use Parse Path when the input might not be an http:// URL.
Can I call it from a microflow?
No. It is a JavaScript action, so it runs client-side in a nanoflow. Call that nanoflow from your microflow.
Does it work in a native mobile app?
Yes. The action uses no platform-specific code, sond native profiles.
Do I need to install anything with npm?
No. parse-path and its dependency ship inside the
What happens with an invalid URL?
Nothing throws. You get an object with parse_failet to file. Branch on that flag.
What happens with an empty string?
That one does throw — "pathURL should not be empty". Check the input before calling.
Why is protocol set to file for something that clearly is not a file?
That is the library's fallback whenever the addresd URL. Read parse_failed alongside it rather thantrusting protocol on its own.
How do I read a single query parameter?
The query attribute is a JSON string — parse it with a JSON action. Alternatively split the raw search attribute yourself.
Why is port empty on a URL that has one?
A known type mismatch in this release. Read the port from host instead. See Known bugs.
Is the returned object stored in my database?
No. The entity is non-persistable, so the result is transient and needs no cleanup.
Do I need any other Marketplace module first?
No. Parse Path has no module dependencies.
Which Studio Pro versions are supported?
10.24.17 and higher. This release was rebuilt from 10.18.3 for the 10.24.17 LTS line.
Issues, suggestions and feature requests:
Releases
**Parse Path** — now supported on Mendix Studio Pro **10.24.17**
Rebuilt from Studio Pro 10.18.3 to **10.24.17** (LTS). No functional changes — this release only updates Studio Pro compatibility.
Import `ParsePath.mpk` via *App Explorer > Import module package* in Studio Pro 10.24.17 or higher.
---
Parses the input URL.
**Features**
**protocols**: URL protocols (typically contains a single protocol).
**protocol**: The primary protocol (e.g., "https", "http", or "file").
**port**: The port number used in the URL.
**resource**: The domain or hostname portion of the URL.
**host**: The full domain, including subdomain and port if present.
**user**: The username used for authentication.
**password**: The password used for authentication.
**pathname**: The path section of the URL, excluding domain and query.
**hash**: The fragment identifier in the URL (the part after #).
**search**: The query string portion of the URL, excluding the leading ?.
**href**: The fully normalized input URL.
**query**: The parsed query string as a key-value object.
**parse_failed**: Indicates whether the URL parsing was unsuccessful.
**Dependencies:**
• Mendix modeler 10.18.3.
**Issues, suggestions and feature requests**
https://github.com/bharathidas/ParsePath/issues
**Screenshots**

