You are viewing limited content. For full access, please sign in.

Question

Question

How to Remove Blanks From Entry Name?

asked on November 29, 2022

Hello,

I am working on a workflow to re-name an entry based off of the serial number fields in the template for the entry. There are multiple fields (ie. S/N 1, S/N 2, S/N 3, S/N 4, etc), that may be used, or only some may be used. In the token dialog the entry name is formatted "SN1-SN2-SN3-SN4" and I'm looking for a way to remove extra blanks and "-" when all of the serial fields are not used, to avoid "SN1-SN2- - -" entry names. So far I am striking out, anyone have any suggestions?

Thanks

0 0

Answer

SELECTED ANSWER
replied on November 29, 2022

You could put the name together then run it through pattern matching to drop the empty dashes at the end. Something like (.+)(\w|\d) to force it to end in a number or letter. Depending on what your serial numbers look like, this pattern may require a bit of tweaking.

3 0
replied on November 29, 2022

Hi Miruna,
 

Thank you very much for the help, that worked perfectly.

0 0

Replies

replied on November 29, 2022

Hello,

 

I saw this post - https://answers.laserfiche.com/questions/110201/Using-the-Retrieve-Field-Values-atoken-option-of-a-multifield-to-rou#110220. Not sure if applicable, as uncertain if your serial number fields is a multifield or if you have separate fields for each serial number option. If it was a multifield, based on this post, it sounds like you could add some conditioning before you rename so that it looks for empty values. I may be way off base here.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.