Encoding Variables: Difference between revisions
No edit summary |
No edit summary |
||
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 18: | Line 19: | ||
Promotion "Learn video editing in just 1 month for free" (2020) | Promotion "Learn video editing in just 1 month for free" (2020) | ||
Will look like this: | Will look like 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.