Milindsinh Solanki Milu Posted June 4 Share Posted June 4 Hello Forum, I'm trying to create a Data Tag that displays the ID Prefix + ID Label of a Door or Window. I’d like to make it universal, so it works for both Doors and Windows using the same tag style. I'm not sure how to set this up properly — does anyone have any ideas or experience with this? Any alternative method to achieve the same result would also be appreciated. Thanks in advance! Quote Link to comment
Pat Stanford Posted June 4 Share Posted June 4 Something like the below should work. Put it in the Advanced Calculated Field Window. If you need other fields, inside the #WS_ # blocks you must use pure Worksheet format. You can't use the Data Tag # # format inside the WS block. You need the IFs so you can specify to display nothing if the object is not that object type. Make sure that the entire string is one line (automatic wrapping is ok). If you enter a return between the two parts, then you will get a blank line above the tag for Windows. #WS_IF(OBJECTTYPENAME='Door', CONCAT(Door.IDPrefix, Door.IDLabel, Door.IDSuffix), '')##WS_IF(OBJECTTYPENAME='Window', CONCAT(Window.IDPrefix, Window.IDLabel, Window.IDSuffix), '')# 2 Quote Link to comment
Tom W. Posted June 5 Share Posted June 5 15 hours ago, Pat Stanford said: Something like the below should work. Put it in the Advanced Calculated Field Window. If you need other fields, inside the #WS_ # blocks you must use pure Worksheet format. You can't use the Data Tag # # format inside the WS block. You need the IFs so you can specify to display nothing if the object is not that object type. Make sure that the entire string is one line (automatic wrapping is ok). If you enter a return between the two parts, then you will get a blank line above the tag for Windows. #WS_IF(OBJECTTYPENAME='Door', CONCAT(Door.IDPrefix, Door.IDLabel, Door.IDSuffix), '')##WS_IF(OBJECTTYPENAME='Window', CONCAT(Window.IDPrefix, Window.IDLabel, Window.IDSuffix), '')# @Pat Stanford is it possible to use this formula + also link the Door/Window ID Suffixes to their data sources...? I have a Door ID tag that looks like this: #Door#.#IDPrefix##Door#.#IDLabel#->#Door#.#IDLabel##Door#.#IDSuffix# And a Window ID tag that looks like this: #Window#.#IDPrefix##Window#.#IDLabel#->#Window#.#IDLabel##Window#.#IDSuffix# Am wondering if I can combine them into a single tag. I couldn't see a way in either the Advanced Calculated Field + Formula panes... Thanks 1 Quote Link to comment
Pat Stanford Posted June 5 Share Posted June 5 Try this. Instead of using the WS_IF, I used the Trinary Operator with a blank "OR" section. I don't know how to test if the link is working properly as I don't use that functionality. #Door#.#IDPrefix##Door#.#IDLabel#->#Door#.#IDLabel##Door#.#IDSuffix#@#Door#.#IDLabel#<>'': #Window#.#IDPrefix##Window#.#IDLabel#->#Window#.#IDLabel##Window#.#IDSuffix#@#Window#.#IDLabel#<>'': Again, the entire formula should be on one line (other than automatic wrapping). 1 Quote Link to comment
Tom W. Posted June 5 Share Posted June 5 1 hour ago, Pat Stanford said: Try this. Instead of using the WS_IF, I used the Trinary Operator with a blank "OR" section. I don't know how to test if the link is working properly as I don't use that functionality. #Door#.#IDPrefix##Door#.#IDLabel#->#Door#.#IDLabel##Door#.#IDSuffix#@#Door#.#IDLabel#<>'': #Window#.#IDPrefix##Window#.#IDLabel#->#Window#.#IDLabel##Window#.#IDSuffix#@#Window#.#IDLabel#<>'': Again, the entire formula should be on one line (other than automatic wrapping). Thanks Pat this doesn't work unfortunately because the Tag thinks it's looking for an object which is a Door + a Window at the same time: I notice the formulas I gave you earlier were wrong so this is what I am using: #Door#.#IDPrefix##Door#.#IDLabel#->#Door#.#IDLabel#@#Door#.#IDLabel#<>'': #Window#.#IDPrefix##Window#.#IDLabel#->#Window#.#IDLabel#@#Window#.#IDLabel#<>'': I don't fully understand why your first Tag - using #WS_# - is happy looking for Doors or Windows whereas the second one isn't...? 1 Quote Link to comment
Milindsinh Solanki Milu Posted June 10 Author Share Posted June 10 #WS_IF(OBJECTTYPENAME='Door', CONCAT(Door.IDPrefix, Door.IDLabel, Door.IDSuffix), '')##WS_IF(OBJECTTYPENAME='Window', CONCAT(Window.IDPrefix, Window.IDLabel, Window.IDSuffix), '')# Thank you. This one by @Pat Stanford works perfectly fine, and beauty is that is doesn't recriminate between door and window.. also thanks to @Tom W. for follow up. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.