Help with converting MSISDN to text while keeping “+”

Hi, I have a variable that contains an msisdn e.g. +6122223333.

This is first used to send an SMS, which works very well. :+1:

Next, I have to use it to create a new document in a Firestore path like /ABC/{{msisdn}}/Logs.

The issue is: the + is dropped and Firestore creates the document under /ABC/6122223333/Logs instead of /ABC/+6122223333/Logs.

I tried inserting + directly but it does not work.

Screenshot 2025-08-25 at 22.36.40

How can I ensure the + sign is preserved or added at the start?

Thanks in advance!

Welcome to the Make community!

In URLs, + is commonly used to represent a space. If you intend for a literal + character to be part of your Firestore path within a URL, it should be URL-encoded as %2B to prevent it from being interpreted as a space.

To encode a variable, you can use the built-in function:

Here’s an example of how you can use this function:

{{ encodeURL("/ABC/+" msisdn "/Logs") }}
(copy-paste the above into the field, or type it exactly as shown)

e.g.:
Screenshot 2025-08-26 000700

Hope this helps! Let me know if there are any further questions or issues.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

Thank you @samliew .

I tried the above solution but it gave a long error. The error message includes this “The requested URL /documents%252FABC%252F%252B6197237204%252FLogs was not found on this server.

I tried improvising with:

image

But that gave me an incorrect Firestore document too (it was “%2B%2B6597237204”).

Are there other methods to replace the MSISDN and get the literal + character? Thank you again!

Hi,

Just to add, I am using the +MSISDN inside the Google Cloud Firestore module.

The Collection Path is an input in this module.

Thank you.

What about just /ABC/%2B{msisdn}/Logs ? Can you take a screenshot of it/the error?

so i did the above and the following document is created in Firestore:

image

It’s looking like: it does not matter what we input before the Firestore module. The Firestore module will not pass “+” as part of a Collection Path.

I do note that in Firestore itself, “+” are allowed. Yes, I know the contradiction is odd, but I cannot explain it further. :folded_hands:

You might need help with Make support on this, or you can try taking a look at the underlying actual request to Firestore by installing the Make DevTools.

If you have the Make DevTool Chrome extension installed, you should be able to view the request and response headers and body from each module when you manually run the scenario.

From Make DevTool - Help Center :

Make DevTool allows you to debug your Make scenarios by adding an extra pane to the Chrome Developer Tools. Using this new debugger pane, you can check all the manual runs of your scenarios, review all the performed operations, and see the details of every API call performed. Additionally, with Make DevTools you can see which module, operation, or response caused an error in your scenario. This helps you debug your scenario and get your scenario back on track.

Hope this helps! Let me know if there are any further questions or issues.

@samliew