Skip to main content

hello! 
I want to automate the creation of subsequent User IDs for each new record (Users) - and I need help.

I have a “Users Table”, and my Primary User ID identifier for my first record is USER001. I created this as a “Test Record” with USER001 as the First Record Created in the Users Table, so it had a baseline.

Then I created a Zap for Tables that is connected to Users Table, then Formatter by Zapier to generate a unique alphanumeric ID for the user_id field in my Users Table.

To split the Alpha/Numeric I first chose Text as the Action Event to extract the number from the USER text, which seemed to work (output 001)

Then again in Formatter by Zapier I chose Numbers “Perform Math Operation” and mapped the output 001 above then Add Value 1

I don’t know where to go from here - or how to recombine them in the next step to make it all work. 

 

Maybe I’m way off in my logic, and there is an easier way. 

Does anyone have any advice or experience on how to create an automation for new User ID’s for new records?

 

Thanks for the help, 

Kris

 

 

Hi ​@KrisHamilton,

 

Welcome to the Community. 

 

To generate a new user ID, split the alphanumeric ID, increment the numeric part, and combine them. Use Zapier's Formatter with a 'Replace' action to update the numeric portion, followed by a 'Pad' operation to add leading zeros if needed. Finally, rejoin the 'USER' prefix and the padded number using the 'Combine' action in Formatter. This process creates the updated user ID for your Zap.

 

I hope this helps! If you have any further questions or run into any issues, don't hesitate to ask.


Hey thanks for the response. I split the alphanumeric ID with user_id as Input and USER as Separator, and segmented index Last - which gave me the correct 001 output. When I use formatter -->Action, Numbers...and choose Perform Math Operation, Operation Value: Add, then for Values Input I map the previous Output: 001 then continue, I get this error response: 

Failed to create a number transform in Formatter by Zapier

The app returned "Expression Error: + is probably missing arguments due to an empty field mapping".

What part am I getting wrong?


Hi there ​@KrisHamilton,

Before we dig deeper into this, would you mind sharing a detailed screenshot of how your Zap is configured? Also, please share a screenshot of the “CONFIGURE” section of the action step/s that shows all of its fields.

Please don't include personal information in the screenshot, or be sure blur out any personal information.

Thanks!


here are the screenshots of the steps I took: 
 


Hi ​@KrisHamilton 👋

Thanks so much for sharing all those screenshots to show the current set up of your Zap with us—very much appreciated! 🧡

If you’re just looking to increment a number by one each time the Zap runs for a new record, I wonder if a easier approach would be to use an Increment Value (Storage by Zapier) action:

b97e3f5017c6f5b092817fee46c41b8a.png

Storage would keep a record of the existing ID number and increase it by 1 each time the Zap runs. Then, you’d select that incremented ID number in the relevant the user ID field on an Update Record (Zapier Tables) action to have it automatically update the user ID for each new record that’s added to the table. For example:

b41b79708ed70c7d696c1a07a4f502ad.png

Granted it wouldn’t have the exact format you’re after with the 00 part included. But if you needed it to have the 00 included you could always add a Code action to output 00 for numbers under 10, 0 for numbers less than 100 and nothing for numbers 100 or greater. Then in the Update Record action, you’d select the value output by the Code action, to have the ids formatted as USER001, USER050, USER200 etc. If you’re not familiar with coding in Javascript or Python we have a AI feature that can help generate the necessary code for you: Generate a Code step using AI (Beta).

Hope that helps to get you pointed in the right direction. If you run into any issues on that or have any further questions just let us know!


Thanks for the suggestion. If I changed the format from USER001 to format USER-1, would your suggestion work better?
 

I am curious, was my previous approach incorrect? I was trying to follow your colleagues suggestion to “split the alphanumeric ID, increment the numeric part, and combine them. His advise seemed pretty straightforward, so I was hoping to understand where I was going wrong. 


Reply