Skip to main content
Nintex Community Menu Bar

Why is the Replace Function Producing a "+" Symbol?

  • July 5, 2019
  • 7 replies
  • 45 views

Forum|alt.badge.img+9

When doing a userProfileLookup, it returns the user's phone number as 618XXXXXXX. How is it then, that the function below replaces "618" with "+(08)"? Why is it adding a + symbol?


replace(userProfileLookup(RequestingOfficer, "WorkPhone"), "618", "(08) ")

3029i6BB0637EDF0A08DC.jpg

7 replies

Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • July 5, 2019

Hi,
Not exactly sure why it would be adding a + but I think the parentheses are affecting the function.
Using {TextStart} and {TextEnd} in the function may resolve the issue.
replace(userProfileLookup(RequestingOfficer, "WorkPhone"), "618", "{TextStart}(08){TextEnd} ")


Forum|alt.badge.img+9
  • Author
  • July 5, 2019

Parenthesis are not the issue, and while using {TextStart}/{TextEnd} has worked for me before in Workflow, it's Forms I'm referring to here, and it doesn't work.

 

I tried a double replace as well, no luck

 

replace(replace(userProfileLookup(RequestingOfficer, "WorkPhone"), "618", " 08"), "+", "")

3030i8ABFF1634D75F2C9.jpg 


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • July 5, 2019

Hi

I tested the rule

replace(userProfileLookup(Current User, "WorkPhone"),618,"(08)")

and it behaved as expected.

 


Forum|alt.badge.img+9
  • July 5, 2019

are you sure the returned phone number is 618XXXXXXX and not +618XXXXXXX?


Simon Muntz
Nintex Partner
Forum|alt.badge.img+23
  • Nintex Partner
  • July 5, 2019

Hi,

I made a quick video.

It shows a Calcualted value control with the formula I suggested to you.

It shows a Calculated value control that just returns the phone number so that you can see what the phone number is before it is put through the replace runtime function.

It shows the users profile with the phone number.

I am using SharePoint 2016 with the latest build of Nintex forms.


Forum|alt.badge.img+9
  • Author
  • July 9, 2019

Not in my case, it still brings up the + symbol. Never mind, I've replaced 618 with a null value and hardcoded (08) instead.


Forum|alt.badge.img+9
  • Author
  • July 10, 2019

As you can see the calculated value is returning a value without the plus symbol.

 

3085i7D536FFA3F2AC364.jpg