Skip to main content
All CollectionsGetting Started
Step 2 - passing more data with your button click
Step 2 - passing more data with your button click

Adding a custom form or key-value pairs to your button click

Updated over a week ago

Make your admin button even more powerful by adding a form or key-value pairs to send unique data along with each button click. For instance, if you'd like to track product issues with a button on your product or product variant pages, you can add a form with a drop down menu and notes fields and use Zapier or Relay.app to save the data to a tracking sheet in Google.

You have two options for sending additional data.

Custom forms for collecting info with button clicks

After defining your button and giving it a quick test to make sure it's sending the object(s) you had in mind, it's simple to add a form.

Next, select the form fields you'd like your staff to complete.

You can add the following types of form fields:

  • Single line text

  • Multi-line text

  • Number

  • Checkbox

  • Choice list

  • Dropdown

Form fields all have a name displayed on the form, as well as a key passed in the JSON object with your click. The key cannot be edited once it is initially created. Form fields can also be optional or required.

Field tips:

  • Need a date field? There is currently no date picker available. Instead, use a single line text field and add a note in the description to indicate the date format that should be used.

  • A number field will not permit the user to enter alpha characters

  • A checkbox cannot be required

  • Choice lists show all options at once, so they're best used with a small number of choices. Select the "multiple choices" option to allow them to be used as checkboxes. To use as radio buttons, allowing just one selection, leave the multi choice option unchecked.

  • If many choices are needed, a drop-down is the best option. These allow only one selection

Form data will be added to the JSON object passed to your end point. If you're using Zapier webhooks, for instance, Zapier will automatically parse the values and make them available in your Zap steps.

"admin_button_form_data": { 
"issue_reported_by": [
"Customer making return"
],
"issue_type": "Durability",
"issue_description": "Started showing wear in the elbows after 3-4 wearings"
},

Passing key-value pairs

Sometimes, it's handy to add key-value pairs to your button clicks. For instance, you could have multiple buttons using the same automation, using key-value pairs to differentiate between the buttons.

Key-value pairs can be added to a button click, whether or not you're using a form. Simply add one or more key and value to the trigger set-up.

These values are also appended to the JSON object:

"admin_button_custom_attributes": { 
"button-type": "product-detail"
},

You're button is all souped up and ready to pass extra data from your Shopify Admin pages. Follow these final quick steps to make sure the button is available to everyone on your store team.

Did this answer your question?