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.

 

Leave a Reply

2 Comments on "Substring in InfoPath"

Notify of
avatar
Sort by:   newest | oldest | most voted
Lise Rasmussen
Guest

Hi Thomas,

You are welcome 🙂
/Lise

Thomas
Guest

Lise, thanks for sharing this formula.

wpDiscuz