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

Question

Question

Copy field data & format

asked on September 3, 2019

Hello,

I have a Field called IP & another field called Network.

IP has constraint to put data in format: XXX.XXX.XXX.XXX

I want that in the field Network the first 3 should be copied from IP, like: XXX.XXX.XXX

 

Please note that both are in a Table..

 

Many Thanks in advance!

 

Regards,

Sahil

1 0

Answer

SELECTED ANSWER
replied on September 3, 2019

Okay. You want to attach this to your formula of your network field. This is assuming that the name of your table is "networkTable" and the name of your IP field is  "ip". Change these in the bottom code to what they will be for you.

 

=CONCATENATE(
INDEX(SPLIT(INDEX( networkTable.ip , ROW()),"."),1),".",
INDEX(SPLIT(INDEX( networkTable.ip , ROW()),"."),2),".",
INDEX(SPLIT(INDEX( networkTable.ip , ROW()),"."),3)
)

 

I hope that helps :).

0 0
replied on September 3, 2019

Perfect!!!

Thanks

1 0

Replies

replied on September 3, 2019

There isn't any way to do it dynamically in the client, but you can certainly do it in Workflow after the document is saved. Then you can just set the field value to the output of a Pattern Matching activity with a regular expression.

\A\d{1,3}\.\d{1,3}\.\d{1,3}

 

0 1
replied on September 3, 2019

This is incorrect. You can use field formulae.

0 0
replied on September 4, 2019 Show version history

My bad. I usually avoid formulas because anything other than the simplest of operations gets so obtuse it's no longer readable. Regex in javascript is ironically easier to read for me. I also missed the forms tag.

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

Sign in to reply to this post.