Skip to main content
Question

Check the value of User Parameter

  • October 2, 2024
  • 2 replies
  • 56 views

arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15

This is either going to be a very stupid question or a very silly bug.

I want to check if MyUserParameter has a value, so I put a Creator and a Tester on my canvas checking whether MyUserParameter does have a value. It tells me it doesn’t, whilst it clearly does! Hmm, what’s going on?

Am I being dumb? Why can I not test a User Parameter?
I can get it by using a ParameterFetcher, so it’s not a big issue.

We recently upgraded from v2023.1 to 2024.1, and I thought this used to work, but I could well be mistaken.

EDIT: It does work if I check if MyUserParameter is of type string or when using RegEx. It sounds like the ‘has a value’ and ‘is null / missing / empty’ doesn’t work with user parameters.

2 replies

liamfez
Influencer
Forum|alt.badge.img+44
  • Influencer
  • October 2, 2024

I am getting the same results as your EDIT note using 2021 version. I think the “Attribute has a value” operator (and the related ones) are meant to only work with attributes.
A possible work around for you, would be to add an AttributeCreator between the Creator and Tester. Creating a new attribute and giving it the value of the parameter. Then the Tester can test that new attribute instead of the parameter, and those operators will work.


arnold_bijlsma
Enthusiast
Forum|alt.badge.img+15

Hi Liam

Thanks for checking. I got to the same conclusion, but it still caught me by surprise:

  1. why I never knew this before!
  2. why there doesn’t seem to be a simple way to check if a User Parameter has a value, i.e. that you must use an AttributeCreator / ParameterFetcher to get it, or - as I have now done - create a RegEx check: $(MyUserParameter) CONTAINS_REGEX \S