cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
brettando
Nintex Newbie

Nintex Forms How can I trim/replace/extract characters from string

Jump to solution

Using Nintex Forms, from a sub-site, when a person opens a link to a new form located in the top-level site, the source= url string is copied into a field using the formula: fn-GetQueryString(Source)

This pastes the url string when the form is loaded as: http://SpServer.com/sites/Programs/1/Pages/default.aspx   (So depending on which sub-site, 1, 2, 3 e...

So what I now need is to display the corresponding Sub-Site Name in a field. I have tried commonSmiley Frustratedite Name but this displays the top-level Site Name, which is no good.

I have another list that was used to create the sub-site using the Create Site Workflow and that has the corresponding Site Name, so I can use a lookup if I can get the 1, 2, 3 etc from the source string url.

The URL path after the 1, will be dynamic, so it could be /1/Pages/Lessons.aspx, /3/Pages/Risks.aspx etc.

Is there a way perhaps using Trim or Replace, that I can extract the sub-site 1, 2, 3 etc at runtime?

Ask if anything is unclear.

Thanks.

Labels: (3)
0 Kudos
Reply
2 Replies
emha
Nintex Newbie

Re: Nintex Forms How can I trim/replace/extract characters from string

Jump to solution

something like following should work.

I'll assume http://SpServer.com/sites/Programs/ is your site URL.

use calculated value control with following formula

replace(replace({TextStart}QURL{TextEnd},{TextStart}{Common:WebURL}{TextEnd}+"/",""),'\\/[\\w\\/\\.]+$',"")

note QURL is name of field which you populate with with query string, so replace it in formula with respective named control reference.

‌ part of path‌

Reply
brettando
Nintex Newbie

Re: Nintex Forms How can I trim/replace/extract characters from string

Jump to solution

Wow, thanks Marian! That works!

Thank you so much, you have saved me a huge amount of change-formula, publish form, refresh page, test, repeat.

Amazing.

Reply