The Scenario
The marketing team submitted a spec last week: 12 new custom contact attributes they want added to Piggy before the next campaign segment runs. Things like preferred_store, tier_level, signup_source, and nine others. The spec is a Google Sheet. The loyalty program administrator has to get those attributes into Piggy before the segmentation rules can reference them.
The bad version:
- Open the Piggy settings panel, find the custom contact attributes section, click Add, type in the attribute name, pick the data type, save.
- Go back to the sheet. Move to row 2. Repeat 11 more times.
- Somewhere in the middle, you create one attribute with a typo in the name. Now the segmentation rule references the wrong field name and the campaign misfires.
This is configuration work, not strategic work. It needs to be done correctly, completely, and before end of day so the dev team can start wiring up the triggers.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the attribute list, submits each creation request to Piggy, and writes the returned attribute IDs back into the sheet — giving you a confirmation record of what was created.
For each attribute name in column A of the 'New Attributes' sheet (12 rows), create a custom contact attribute in Piggy and write the returned attribute ID into column B
What You Get
- Column B fills with the Piggy attribute ID for each successfully created attribute.
- Rows where creation failed (duplicate name, invalid characters, API error) get an error note in column B so you can fix and retry without re-running the whole batch.
- You get a permanent record of which attribute names correspond to which Piggy IDs — useful when the dev team needs to reference them in loyalty rule configurations.
- All 12 attributes are created in one pass, not one click at a time.
What If the Data Is Not Quite Ready
Some attributes may already exist in Piggy and shouldn't be duplicated
For each attribute name in column A, check whether a custom contact attribute with that name already exists in Piggy. Write EXISTS into column B for any that are already there, and create the rest. Write the new attribute ID into column B for newly created ones
The sheet also defines the data type for each attribute in column B
For each row in the 'New Attributes' sheet, create a Piggy custom contact attribute using the name from column A and the data type from column B. Write the returned attribute ID into column C and the creation status into column D
Attribute names need to be normalized to snake_case before creation
For each value in column A, convert the text to lowercase snake_case (replace spaces with underscores, remove special characters), then create a Piggy custom contact attribute with the normalized name. Write the normalized name into column B and the returned attribute ID into column C
Validate names, normalize format, create attributes, and build a reference map in one pass
Read all 12 attribute names from column A. Normalize each to lowercase snake_case. Check whether each already exists in Piggy. Create the ones that don't exist. Write the final normalized name into column B, the attribute ID into column C, and the status (CREATED, ALREADY EXISTS, or ERROR) into column D. Write the total created count into cell F1
Building the reference map inline means the dev team gets a sheet they can consult directly rather than cross-referencing the Piggy UI.
Try It
Open a Google Sheet with your attribute name list and Get the 7-day free trial of SheetXAI. Ask it to provision all your new Piggy contact attributes and write the IDs back. For related workflows, see how to merge duplicate contacts in bulk or the full Piggy integration overview.
