String Replace Issue
Moderators: anncoupe, anncoupe
String Replace Issue
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?
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?
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.
-
- Newbie
- Posts: 2
- Joined: Fri May 05, 2023 4:12 am
Re: String Replace Issue
Can you be more specific about creating such a URL?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 uno online
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
Re: String Replace Issue
The URL is formatted to be passed into the body of an email for the purpose of uploading artwork, and submitting the link through API to our project management website is also supported.Mirandajoye wrote: ↑Mon Jun 26, 2023 5:31 amCan you be more specific about creating such a URL?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 slope game
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
-
- Newbie
- Posts: 3
- Joined: Wed Jan 04, 2023 8:53 am
Re: String Replace Issue
In the context of an "HTTP request" element, the URL property takes the provided value as is. This means that any special characters, including spaces, should be properly URL-encoded in the URL property.rhd_ole wrote: ↑Tue Jan 03, 2023 12:34 pmThank 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 Geometry Dash
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.
-
- Newbie
- Posts: 2
- Joined: Fri May 05, 2023 4:12 am
Re: String Replace Issue
That's it, I have a better understanding of this issue, thank you very muchfrailwhen wrote: ↑Mon Jul 17, 2023 5:17 amThe URL is formatted to be passed into the body of an email for the purpose of uploading artwork, and submitting the link through API to our project management website is also supported.Mirandajoye wrote: ↑Mon Jun 26, 2023 5:31 amCan you be more specific about creating such a URL?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 connections
or with:
URL: https://mysite.com
Parameters: param 1=value 1
param 2=value 2
-
- Newbie
- Posts: 2
- Joined: Tue Sep 05, 2023 6:29 am
Re: String Replace Issue
Check that the Set Private Data component is placed after the step where the value gets changed, not before.dino game
Re: String Replace Issue
It seems like you're facing an issue with the String Replace function. To address this problem, consider the following solution:
Check the Data Format: Ensure that the format of your data in the "description" privatedata key matches exactly with "START" (e.gword finder, no extra spaces or characters). Verify the Separator: Confirm that the separator used in your data is indeed an equal sign (=).
Check the Data Format: Ensure that the format of your data in the "description" privatedata key matches exactly with "START" (e.gword finder, no extra spaces or characters). Verify the Separator: Confirm that the separator used in your data is indeed an equal sign (=).
-
- Newbie
- Posts: 1
- Joined: Fri Jun 30, 2023 10:57 am
Re: String Replace Issue
That's a great solution, I really like it. thank you for sharing!annajenny wrote: ↑Mon Sep 18, 2023 9:02 am It seems like you're facing an issue with the String Replace function. To address this problem, consider the following solution:
Check the Data Format: Ensure that the format of your data in the "description" privatedata key matches exactly with "START" (e.gword finder, no extra spaces or characters). Verify the Separator: Confirm that the separator used in your data is indeed an equal sign (=).
Vampire Survivors
-
- Newbie
- Posts: 3
- Joined: Mon Jul 17, 2023 4:13 am
Re: String Replace Issue
Make sure the Set Private Data step comes after the one in which the value is modified gorilla tag