punkdumbo
Rookie

How to delete first 4 numbers of autofilled field

Jump to solution

Hello

I would like to ask this:

 

I have a field that is automatically filled in (javascript) depending previous dropdown choice. But it is always a number lets say 1111 1111.

My intention is to delete first 4 numbers of the field by String format - I have tried fn-Remove(Something, 1, 4) but that doesnt work.

 

What should I do to make it work please?

0 Kudos
Reply
2 Replies
MegaJerk
Collaborator

Re: How to delete first 4 numbers of autofilled field

Jump to solution

Question 

1. Do you want the Autofilled value of "1111 1111" to instead produce only "1111" 

 

Or

 

2. Do you want the Autofilled value of "1111 1111" to remain there, and instead just want to take the last n number of digits of that value to use somewhere else? 

---

 

If it's the 1st one, then we'd need to see the code being used to autofill the control. 

 

If it's the second one then you can just use SubString to get the values starting at the position you care about up to some arbitrary length of characters. 

 

example

 

I have two controls. A Single Line Text called "someNumbers" and a Calculated Control:

MegaJerk_0-1659593949092.png

 

SLT Control is configured with a default value of some numbers sort of like how you have shown:

MegaJerk_2-1659594078708.png

 

 

The formula for the Calculated Control is as follows:

MegaJerk_1-1659593990555.png

 

All substring does is take a string, takes a starting position, and then returns up to the number of characters you specify

 

So for the string "1111 1234", I'm telling it to start at the 4th position (the last 1), and then get 10 characters to the right of that. If you don't know how many characters there are after that, or only need to get a certain amount of specific characters after that, then we'll have to use a different method, but going only off of what you've posted, this may work depending on your circumstances. 

 

Let me know. 

 

 

0 Kudos
Reply
punkdumbo
Rookie

Re: How to delete first 4 numbers of autofilled field

Jump to solution

Thanks for your answer! Second option solved the case.

0 Kudos
Reply