Hello Switch World -
To keep this simple, I'm trying to make a URL that is web safe. So I need to remove the spaces and replace them with %20.
The URL is built from various privatedata values and some static info.. Only one privatedata value will ever contain spaces, "description" this is the string I need to change
After searching the forums, String Replace seemed to be the easy solution, however I don't get any results even when trying to replace a word such as "START" with "DONE"
My process and how String Replace is setup:
I'm looking to change the value in privatedata key "description". ( in my test the value is START this test )
Mode: Privat Data
Data: [Job.PrivateData:Key="description"
Separator: =
Strings: START=DONE
Global: Yes
Ignore case: Yes
The result is the same "START this test" vs what it should be "DONE this test" as the new privatedata.
Am I missing something or is there another way?
String Replace Issue
Re: String Replace Issue
In the Property "Data" you should have the name of the Private Data key.
In other words it should just say "description"
Then if there is a value "START" in that Private data value you will get the result "DONE", otherwise nothing will happen.
In other words it should just say "description"
Then if there is a value "START" in that Private data value you will get the result "DONE", otherwise nothing will happen.
Re: String Replace Issue
I feel dumb now, but thank you very much. Of all the things I tried, this didn't cross my mind but makes total sense now that you pointed it out.
Works perfectly!!
Thanks again.
Re: String Replace Issue
Another consideration is the following: the URL property of the "HTTP request" element takes the provided value as is, but the values of the Parameters property are automatically URL-encoded (replacing a space by %20 is only one of many replacements that can be done).
Concretely speaking, if you have to create a URL like https://mysite.com?param%201=value%201& ... =value%202 you can do that with:
URL: https://mysite.com?param%201=value%201& ... =value%202
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
Concretely speaking, if you have to create a URL like https://mysite.com?param%201=value%201& ... =value%202 you can do that with:
URL: https://mysite.com?param%201=value%201& ... =value%202
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
Re: String Replace Issue
Thank you the suggestion I will look into that.freddyp wrote: ↑Tue Jan 03, 2023 8:59 am Another consideration is the following: the URL property of the "HTTP request" element takes the provided value as is, but the values of the Parameters property are automatically URL-encoded (replacing a space by %20 is only one of many replacements that can be done).
Concretely speaking, if you have to create a URL like https://mysite.com?param%201=value%201& ... =value%202 you can do that with:
URL: https://mysite.com?param%201=value%201& ... =value%202
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
A bit of background what I'm doing here. I do have it working. The URL is built to pass into an email body for art upload but also posting the link via API to our project management site, this is similar to Monday.com, Smartsheets, etc. It was the last missing part.