Interchange Icons in buttons

I am trying to create a large array of button types that will include icons before and after for the scenario. Now I am trying to figure out if I can swap the icons out in various instances. E.g. I have a button with an icon and text, but I’d like to change the checkmark icon to an X icon. Has anyone figured this out?

Figured out 3 years ago: