Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Number formatting for autogenerated numbers

Stephen Pease
Contributor
October 17, 2022

Hello Atlassian Community, 

 

I am utilizing a nice guide found here: Using generate next number IFTTT rule to have sequence numbers per day - Vertuna WIKI - ConfiForms for generating an autonumber that resets each day, however, is there a way to format it so it is always 2 digits?

Right now it outputs 1,2,3,4

But I would like it to output 01,02,03,04.

Is this possible leveraging what is basically a copy-paste of the provided example? Thank you!

1 answer

1 accepted

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
October 17, 2022

You can use formatNumber function by setting the ConfiForms Field macro's field name parameter to seqNo.formatNumber(00) when rendering the value of a seqNo field

Screenshot 2022-10-18 at 08.51.46.png

Stephen Pease
Contributor
October 19, 2022

Hi Alex, 

I feel like this is the right way, but I am having trouble getting it to work. Here is the layout of my current setup (only difference is "531" is added to the SeqNo) along with the views of the 3 macros in order.

Overview.PNG

ConfiformsFormFieldDefinition.PNG

IFTTT.PNG

ConfiformsFormField.PNG

The first standout is that I don't have a macro that only gives me "Confiforms Field Macro" 

Currently, when I get the email, it is still showing single digit numbers with no leading "0" for those single digits (though the email has "[entry.SeqNo531]" with nothing added. 

I am wondering if I should be putting this in the highlighted section for "Override output format" or if I am just setting it up incorrectly. Thank you!

Alex Medved _ConfiForms_
Community Champion
October 19, 2022

Not sure why you use [entry.field_name] notations and not ConfiForms Field macros, but… the functions can of course be used there as well

so just put [entry.SeqNo531.formatNumber(00)]

Stephen Pease
Contributor
October 19, 2022

I added that line in the email output and now when the email comes in, the sequence number is blank. 

Here is a look at the body of the email with the circled part being the main piece of interest. Basically, it does a Julien Calendar number, adds a selection, then creates a tracking number that resets each day. So far it works minus the double digit part, however, if I try to use the format line, the email blanks out the SeqNo531 part. Sorry if I am doing something dumb, just trying to figure out why it is so close but not cooperating.

email.PNG

Alex Medved _ConfiForms_
Community Champion
October 19, 2022

I can only think of the garbage added by the editor - are you sure the expression is clean  [entry.SeqNo531.formatNumber(00)]

Could you verify the storage format for this piece of contents?

Like Stephen Pease likes this
Stephen Pease
Contributor
October 19, 2022

I apologize Alex, I'm not sure how to verify this. Is there a specific place for me to look?

Alex Medved _ConfiForms_
Community Champion
October 19, 2022

Do you have this option?

Or try to open a notepad and type the  [entry.SeqNo531.formatNumber(00)] and then copy it from there into the IFTTT in-place of the existing expression and see if it helps

Stephen Pease
Contributor
October 19, 2022

You were correct (as usual). I re-pasted the line into that space and now it is showing up correctly. It was definitely some garbage interference from the editor. Thank you so much, everything is working like a charm. To your bosses - give this man a raise!

Alex Medved _ConfiForms_
Community Champion
October 19, 2022

Awesome! Glad to help

Like Ghetto 777 likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events