It's using the HTML Styles in Chat trick that Oosh explains here . Basically, you're creating a 'button' with the text of the attribute names and 'injecting' some html style to force it to only display when it is present. Basic API button: [Button Name](buttonlink) API button with styling: [Button Name](buttonlink " style="") API button with styling that prevents it from displaying at all: [Button Name](buttonlink " style="display:none;") API button with styling that prevents it from displaying when an attribute is missing: [Button Name](buttonlink " style="display:block; display:none@{selected|ATTRIBUTENAME|max};") What happens is you don't have an attribute named 'ATTRIBUTENAME', there is no 'max' field, so an error message gets pulled instead. So the style becomes style="display:block; display:noneERRORMESSAGE;" and the display:block; is kept and used. If there was an attribute called 'ATTRIBUTENAME', and it doesn't use the 'max' field (most don't), then it becomes style="display:block; display:none ;" and whatever the last version of an attribute in a style tag is what will be used, so the 'none' overrides the 'block', and the button isn't displayed. At that point it's an issue of knowing what all the correct attribute names are, and getting the correct order of the style tags so they cancel out in the way you want. I started by doing it all manually (which is a pain the butt) and just incrementally adding more $#, then figured it would be easier to just create an excel spreadsheet that does the incrementing for me. That ends up being about the same amount of work. One issue for the macro you want to create is that the repeating resource fields do use the max field.