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 common:Site 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.
Solved! Go 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.
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.