To encode only just the URL path instead of full URL, you’ll need a minimum of two modules:
This is just an example. There may be a simpler solution.
Module Export - quick import into your scenario
You can copy and paste this module export into your scenario. This will import the modules (with fields/settings/filters) shown in my screenshots above.
-
Move your mouse over the line of code below. Copy the JSON by clicking the copy button on the right of the code, which looks like this:
-
Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.
-
Click on each imported module and re-save it for validation. There may be some errors prompting you to remap some variables and connections.
JSON module export — paste this directly in your scenario
{"subflows":[{"flow":[{"id":10,"module":"util:SetVariable2","version":1,"parameters":{},"mapper":{"name":"original_url","scope":"roundtrip","value":"https://api.typeform.com/responses/files/4dcb0f67a3d13ac4405bd1f7e80a38bacbb93f5567a173274ccf4972d75d4321/Mandat_de_gestion_Butler___Propriétaire___Commission_TAGS__8_.pdf"},"metadata":{"designer":{"x":819,"y":259,"name":"Original URL"}}},{"id":13,"module":"builtin:BasicFeeder","version":1,"parameters":{},"mapper":{"array":"{{split(10.original_url; \"/\"; true)}}"},"metadata":{"designer":{"x":1064,"y":260,"name":"Split URL into paths"}}},{"id":12,"module":"util:TextAggregator","version":1,"parameters":{"rowSeparator":"other","otherRowSeparator":"/","feeder":13},"mapper":{"value":"{{replace(encodeURL(13.value); \"/(?<=https?)%3A/\"; \":\")}}"},"metadata":{"designer":{"x":1313,"y":259,"name":"Combine encoded paths"},"parameters":[{"name":"rowSeparator","type":"select","label":"Row separator","validate":{"enum":["\n","\t","other"]}},{"name":"otherRowSeparator","type":"text","label":"Separator"}],"advanced":true}},{"id":8,"module":"http:ActionGetFile","version":3,"parameters":{"handleErrors":false},"mapper":{"url":"{{12.text}}","serializeUrl":false,"method":"get","shareCookies":false},"metadata":{"designer":{"x":1557,"y":257},"parameters":[{"name":"handleErrors","type":"boolean","label":"Evaluate all states as errors (except for 2xx and 3xx )","required":true}]}}]}],"metadata":{"version":1}}
Note: Did you know you can reduce the size of blueprints and module export code like the above, using the Make Blueprint Scrubber?
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!