I'm using the action
extract substring from index of string.
the list values are like: 12;#Project Lunch
So I want to extract the text after the # sign, but designer won't let me just put a # in the "starting at"
thanks,jb
Technology Tips and News
I'm using the action
extract substring from index of string.
the list values are like: 12;#Project Lunch
So I want to extract the text after the # sign, but designer won't let me just put a # in the "starting at"
thanks,jb
I don't see Substring-before or after as an option in designer.
Those are in InfoPath, but I don't remember all the options in SPD. These are new as of 2010 and didn't exist in 2007. Are there not several other substring commands?
Your correct it is a lookup, but I'm using the Ilovesharepoint lookup with picker http://ilovesharepoint.codeplex.com/releases/view/44989
For some reason it doesn't give me the option to return the field as a lookup value :(
I contacted the author of the project to see if there is anything he could do.
I don't want to go back to a drop down for that lookup. the picker works SO much better :)
Did you ever find a solution to this? I am facing the same problem, also using the ilovesharepoint picker.
Thanks.
Ok, this thread is quite old, but I thought it might be worth putting down my solution for it in case somebody else searches for it. It's a little elaborate, but it seems to work:
Quick background: I have two document libraries with lookup columns, both looking up data in the same list. The lookup columns use the ilovesharepoint picker. If I ran a workflow on item in Library A, I wanted to find the corresponding item in Library B.
The first thing I needed were some custom actions that allow me to do some string manipulation. That way I could extract the ID part of the lookup field in Library A. I used SharePoint Designer Workflow String Actions http://spdwfstringactions.codeplex.com/discussions for it. I used those new actions in my workflow to grab the ID of the lookup field. So from "1234#;Something" I extracted the substring "1234" and stored it in a variable.
Now I knew the ID of the item in the lookup field of Library A. But I needed something to compare that ID with in Library B. Of course I cannot compare the ID with the content of a lookup field. So what I did next was use that new SharePoint 2010 functionality that allows you to display other columns alongside a lookup column. I want to Library B, into the list settings and configured the Lookup field to also bring along the ID column from the lookup list (let's call this the "Foreign ID").
Finally it was just a matter to compare my newly extracted number that I got from the lookup column in Library A with the Foreign ID column I had in Library B. If they matched then I knew the two lookup columns matched.
Hope this makes sense and helps other people to get it working. Might not be the prettiest solution but it works.
I have a similar issue using the ILovesharePoint Filtered Look-up.
Can anyone tell me what the "1234" from the string "1234#;Something" is referring to. I have checked my lists and its not the ID of the item being looked up and it seems to have no relation to the current list.
I either need to be able to extract the "Something" or get a count up to the ";".
I do get just the "1234" if I set the variable AS Integer. I guess I could use a primary workflow to put that into another column then use a LEN to get the number of characters. Then in the other workflow use the LEN value in the Extract String from a specific number. But this seems like more work than it should be?
Any ideas?
Here's a way to do it with the SharePoint Designer Workflow String Actions (see my post above for the link):
Yeah, four functions isn't great, but it seems to work.
Hi
yes
but you can write it by your self
Using SHP Designer got to code side of the page, locate the tag and in the xslt fill the substring-before to match your needs
It's the easier way
That looks like a Lookup field value! You don't have to parse them. When you create the workflow variable or use the field, you'll see a dropdown that says "Return field as". Instead of selecting the default (String), select Lookup Value (as Text) and the workflow will strip the 12;# off and give you Project Lunch.
Doug,
thanks wery much, worked for me perfect!!
Thanks.
Karel
You cannot get indexOf out of the box, which makes this difficult. You can get solutions from CodePlex to allow this, if you have an on-premise installation with a SharePoint/governance team that will allow it.
Other option is to use a SP2013 and SP2010 workflow together or just use a SP2013 workflow. SP2013 workflows can do indexOf and other string operations that allow improved substring capabilities to 2010. If you need to use 2010 at the end of a workflow, or in parallel, then you can launch one from the SP2013 workflow.