# Component Custom Method illegal char in parameters

**URL:** <https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531>\
**Category:** Ignition Early Access\
**Created:** [March 23, 2022, 2:05pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531 "2022-03-23T14:05:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 23, 2022, 2:05pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/1 "2022-03-23T14:05:15Z")

</div>

Hello  
I want to pass the default value for one of my function in Custom Methods as a string that includes “/” but Perspective get it as illegal char, so I wonder how I can pass this string.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/b/cbe47cdb571fa32af2219a1282195148085b36e4.png)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 23, 2022, 2:14pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/2 "2022-03-23T14:14:26Z")

</div>

Does `'//'` work? As in `iconPath="MES//OEE"`

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 23, 2022, 2:15pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/3 "2022-03-23T14:15:11Z")

</div>

No

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [March 23, 2022, 2:21pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/4 "2022-03-23T14:21:30Z")

</div>

The only non-alphanumeric characters allowed are underscore, space, comma, single quote, backslash, equals and asterisk.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 23, 2022, 2:26pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/5 "2022-03-23T14:26:37Z")

</div>

So what should I do to use “/” for my default value as function args?  
It is totally unacceptable and makes this function is useless for us. When we put those chars in " " and pass it as str it should not get the error.

---

<div class="post-metadata">

**Author:** ![andrews](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@andrews](https://forum.inductiveautomation.com/u/andrews)\
**Post date:** [March 23, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/6 "2022-03-23T14:28:55Z")

</div>

Have you tried the backslash `"\"` it should work.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 23, 2022, 2:32pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/7 "2022-03-23T14:32:31Z")

</div>

I’ll open an issue for this… you should technically be able to do this but the validation logic for the parameters field isn’t sophisticated enough.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 23, 2022, 2:39pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/8 "2022-03-23T14:39:18Z")

</div>

You an always make it a project library function and call that, that works as a parameter in that context.

I am curious as I never make custom methods on components but what benefit do you get from having it as a component custom method vs. a project library method?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 23, 2022, 2:44pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/9 "2022-03-23T14:44:29Z")

</div>

As a work-around, use a default of `None` and check for `None` before the rest of the code.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 23, 2022, 2:52pm UTC](https://forum.inductiveautomation.com/t/component-custom-method-illegal-char-in-parameters/57531/10 "2022-03-23T14:52:47Z")

</div>

Just make everything compact and in the same place. It is easy to export and import around without worrying to miss the lib.  
Of course, if it is more general and can be used for other components I will put it in project lib.
