Skip to main content

How to Limit the number of character of the record ID fct ?

  • January 25, 2023
  • 4 replies
  • 60 views

Forum|alt.badge.img+1
  • New Participant
  • 2 replies

Hi everyone,

 

I am trying to simplify the record ID function output as I don't need a complex unique ID. 

2 solutions:

- Is it possible to limit the record ID function to 4 maximum digits ? 

- Is there any other function that will generate a unique ID composed of 4 digits with the random choice of number and/or letters ?

Thank you 😉

4 replies

bruceconsulting
Forum|alt.badge.img+13
  • Inspiring
  • 56 replies
  • January 25, 2023

This function will return the first 4 digits of the record ID:

LEFT(RECORD_ID(),4)
There isn't a function I can think of to produce random choices, you would have to look for a script.
If you have any further questions, I would be happy to help. Feel free to book some time with me using my Calendly link:  https://calendly.com/bruce_consulting/30min

Forum|alt.badge.img+1
  • Author
  • New Participant
  • 2 replies
  • January 25, 2023

This function will return the first 4 digits of the record ID:

LEFT(RECORD_ID(),4)
There isn't a function I can think of to produce random choices, you would have to look for a script.
If you have any further questions, I would be happy to help. Feel free to book some time with me using my Calendly link:  https://calendly.com/bruce_consulting/30min

thank you but unfortunately it's not what I am looking for as it generates duplicate solution 😕😕 (cf picture attached)

 


bruceconsulting
Forum|alt.badge.img+13
  • Inspiring
  • 56 replies
  • January 25, 2023

How about creating an autonumber field and concatenating it with the above formula.  This should give you an unique 4 digit number for each record:

CONCATENATE({AutonumberFieldName},LEFT(RECORD_ID(),3))

Forum|alt.badge.img+1
  • Author
  • New Participant
  • 2 replies
  • January 25, 2023

How about creating an autonumber field and concatenating it with the above formula.  This should give you an unique 4 digit number for each record:

CONCATENATE({AutonumberFieldName},LEFT(RECORD_ID(),3))

Smart - that's a solution indeed - thx
will leave this post open in case there are other ideas.

thx again 🙂