Hide @ItemId if contains specific characters

Hi,

I would like to hide the @ItemId in a template if the item if includes specific characters (numbers or letters). Is this achievable?

Thank you!
Zainab

Hi Zainab,

Please read the following forum post where I explained how to hide the column and also resize the table dynamically.

It should give you the information that you are missing.

Hi Albin,

In our system, products may or may not have an external item Id. Therefore, we have one column for both internal and external Ids (if external Id is available)

When the product has an external item Id, the internal Id always includes “EXT” at the end. What I need to do is: if the @ItemId contains “EXT” then hide the @ItemId field tag.

I don’t want to hide the entire column, just a field tag inside the column. Do you think this is possible to achieve?

Many thanks in advance!

Zainab

Hi Zainab,

I’m not sure I understand correctly. You have two different columns for the external and internal ID. If the internal id contains EXT, then both the internal and external ID should be hidden?

Hi @NatasaKA,

Thank you for the prompt response

We have one column that contains both internal and external item numbers.

Only few items have external item number. On the cases where an external item number is available, we would like to hide the internal item number and only print the external item number on the template.

When an item has external item number recorded against it, the internal item number always contain ‘EXT’ as part of the internal item number. What I would like to do is:
If @ItemId contains ‘EXT’, hide @ItemId

Hope this makes sense!

Kind Regards,
Zainab

Hi Zainab,
please could you send a picture of the template or the template where you want to implement this condition?

Hi @NatasaKA,

I emailed you screenshots of the template.

Thank you!
Zainab

Hi @zainab.jahad ,

You can conditionally show or hide a field by inserting an IF-tagging element around it. You first need to select the Field tagging element that you want to conditionally show/hide by clicking on the Field tab on the element.

After it is selected, click the IF-tagging element in the toolbar. This will add IF-tagging element around the Field tagging element.

Next, you need to insert a conditional expression which will control when it will show/hide the content.

You can use this expression (please fix the path and field names per your data):
not(contains(@ItemId, ‘EXT’))

The contains() function will return true when the second parameter (‘EXT’) is found in the first parameter (@ItemId). Since you want to hide the field when ‘EXT’ is found in @ItemId, we will use not() function that will negate the entire expression therefore make the content visible when @ItemId does not contain ‘EXT’.

You can also use the expression without not() function by checking Invert checkbox in the Properties of the IF-tagging element. This will invert the logic for showing/hiding i.e. it will hide when the expression evaluates to true and show it when the expression evaluates to false.

Please try it and let me know how it goes.

Hi @SemirT,

I emailed you the results with the actual template. please let me know if you received my email.

Thank you,
Zainab

Hi @zainab.jahad,

We didn’t receive any template at the support email.
Could you please resend it to support@docentric.com?