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.

 

5
1
vote
Rate this article!
Subscribe
Notify of
guest

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

2 Comments
newest
oldest most voted
Inline Feedbacks
View all comments
Thomas

Lise, thanks for sharing this formula.

Lise Rasmussen

Hi Thomas,

You are welcome 🙂
/Lise