Encoding Variables: Difference between revisions
(Created page with "{{#seo: |title=Encoding Variables |titlemode=append |keywords=planfix, templates, documents, variables, encoding variables |description=Encoding Variables }} Various functions can be applied to variables in Planfix. One of them is: '''::encode=url''' Suppose you have a task to create a link that, when clicked, passes specific additional parameters from the task, such as the name of a training course. The link then looks like this:...") |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
'''::encode=url''' | '''::encode=url''' | ||
Suppose you have a task to create a link that, when clicked, passes specific additional parameters from the task, such as the name of a training course. The link then looks like this: | Suppose you have a task to create a link that, when clicked, passes specific additional parameters from the task, such as the name of a training course. The link then looks like this: | ||
Line 14: | Line 15: | ||
<pre>https://site-course.com/forms/about-course/?course_name={{Task.LEAD's Source}}</pre> | <pre>https://site-course.com/forms/about-course/?course_name={{Task.LEAD's Source}}</pre> | ||
Promotion "Learn video editing in just 1 month for free" (2020) | However, if the course name contains invalid characters, the link data will not be transferred correctly. For example, a link with such a course name: | ||
Promotion "Learn video editing in just 1 month for free" (2020) | |||
Will look like this: | Will look like this: | ||
<pre>https://site-course.com/forms/about-course/?course_name=Promotion</pre> | <pre>https://site-course.com/forms/about-course/?course_name=Promotion</pre> | ||
This is because the link contains spaces, and special characters that are not allowed when creating the link. All these characters must be encoded. The '''::encode=url''' function is added to the variables to encode this. | This is because the link contains spaces, and special characters that are not allowed when creating the link. All these characters must be encoded. The '''::encode=url''' function is added to the variables to encode this. |
Latest revision as of 10:10, 28 February 2024
Various functions can be applied to variables in Planfix. One of them is:
::encode=url
Suppose you have a task to create a link that, when clicked, passes specific additional parameters from the task, such as the name of a training course. The link then looks like this:
https://site-course.com/forms/about-course/?course_name={{Task.LEAD's Source}}
However, if the course name contains invalid characters, the link data will not be transferred correctly. For example, a link with such a course name:
Promotion "Learn video editing in just 1 month for free" (2020)
Will look like this:
https://site-course.com/forms/about-course/?course_name=Promotion
This is because the link contains spaces, and special characters that are not allowed when creating the link. All these characters must be encoded. The ::encode=url function is added to the variables to encode this.
The correct link with variables should, therefore, look like this:
https://site-course.com/forms/about-course/?course_name={{Task.LEAD's Source::encode=url}}
And the generated link after applying encoding will look like this:
So, the course name is transferred to the link without loss.