Start a new topic
Answered

How to reference custom properties in tasks and templates?

Custom properties are a nice addition, however there is no way to reference them for use in tasks or key sequences. It would be nice if I could do something like the following.


Custom Property Name - user1

Custom Property Value - user1password


sftp user1:$this.cp.user1$@$URI$


Best Answer

Hi Ryan,


you can already refer to custom properties:

image


You can select the Custom Property in the replacement token menu and then you need to refer to it using only alphanumeric characters without space.


Regards,
Stefan


Answer

Hi Ryan,


you can already refer to custom properties:

image


You can select the Custom Property in the replacement token menu and then you need to refer to it using only alphanumeric characters without space.


Regards,
Stefan

Oh, very nice! When you reference Custom Properties inside a template, are the properties used from the template itself or from the original connection? Is there an alternative to $this.XXX$ syntax for this? Something like, $source.XXX$ for all properties/fields?

In general, all replacement tokens refer to the context connection unless the $this.xxx... is used.


Let me know if this helps.


Regards,
Stefan

Ahh, this does work. My issue in testing with CustomFields was if the template is set to "inherit from parent" the field will not pull from the context connection. It worked great once i changed that.


This leads me to another question, can CustomProperties be inherited? In my opinion these are much more usable since you can reference them by name compared to custom fields which are more abstract.

Custom Properties cannot be inherited right now. We could implement that but this would affect all custom properties. Inheriting individual custom properties will not work in the current architecture. Would an all or nothing approach be sufficient?

All or nothing would work, however, what if two custom properties happened to have the same name? Which one would take effect?

Ok, I will see how fast we can implement inheritance for the custom properties page.


If you have two with the same name, there's no particular order/rule which one is picked. This can be random but I think it will be the first in the list.

Interesting. Obviously we would try to avoid that situation. Would the the reference to a custom property be something that is logged? This would allow us to troubleshoot failed calls if there were issues.


Thanks!

Right now there's no logging but I will see if we can somehow check if there are duplicates and create a log entry then.

That would be helpful. Thanks Stefan!

Hi Ryan,


the next release will have the inheritance and logging for duplicates on board.


Regards,
Stefan

Login or Signup to post a comment