Substring in InfoPath

To get a value AFTER a character
substring-after(FieldName, “;”)
This will return all text after the character ;


To get a value BEFORE a character
 substring-after(FieldName, “;”)
This will return all text before the character ;


Substring and Concatenate

I often use Concatenate to join text from two fields. For example, the Date function now() has a “T” between Date and Time. I usually create a new field where I use substring and concatenate to replace the T with a space. Formula:

concat(substring-before(DateTimeField; “T”), ” “,substring-after(DateTimeField; “T”))

This gives me the date and time in one single field with a space between.

 

Share this blog post:

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
ThomasLise Rasmussen Recent comment authors

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
newest oldest most voted
Notify of
Lise Rasmussen
Guest

Hi Thomas,

You are welcome 🙂
/Lise

Thomas
Guest

Lise, thanks for sharing this formula.