infopath Usefull Function's for sharepoint



substring-before():
Syntax: substring-before(field1,field2)
Her it will return the text presented in field1 that precedes the first occurrence of field2.

Example:
substring-before("ABC PQR"," ") will return "ABC". Here we are doing string manipulation based on blank space.

Similarly substring-after("ABC PQR "," ") will return "PQR"
sbustring("ABC",1,1) - This will return "A".
Replace blank spaces with underscores (_). I was just thinking if there is any direct function for replace which was not there.The way I did by using the translate function. Open the Insert Formula dialog box (Open the Rule Details dialogbox and then click on fx in the Value textbox).

Then in the Insert Formula write the function like below:
translate(Title," ","_").

Convert To UPPER case:
translate(my:FieldName, "abcdefghijklmnopqrstuvwyxz", "ABCDEFGHIJKLMNOPQRSTUVWYXZ")

Convert to lower case:
translate(my:FieldName, "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz")

Convert first letter to UPPER case:
concat(substring(translate(my:FieldName, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(my:FieldName, 2, string-length(my:FieldName) - 1))

Check Length in Custom Rule in

string-length(translate(., "()- ", "")) = 10

Comments

Popular posts from this blog

WCF interview questions

The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program

what is Event Cache table in sharepoint