Extracting text from src attribute of Image tag & href attribute of Anchor tag using Nintex Workflow

Business Requirement

I have two SharePoint list fields( Logo and Profile) of type ‘multiple lines of text’ with enhanced rich text format where user will embed or upload company logos or zip files inside. From Logo column I have to extract the values of “src” attribute of the Image tags and from the Profile column I have to extract the values of “href” attribute of Anchor tags using Nintex workflow.

When I queried the multiple lines of text column using Query List Action I got the following output for the Image and and Anchor Tags

Output from the Logo Column -Anchor Tag

/sites/ps/addressbook/Lists/Company/Attachments/39/image0.GIF” border=”0″ height=”41px” width=”47px” />

Output from the Logo Column -Anchor Tag

Now my requirement is to extract the text from src attribute of Image tag & href attribute of Anchor tag using Nintex Workflow whenever an item created or modified

In nintex there is no function like sub-string before or sub-string after in the available in-line functions

Then how to do this?

Solution

For both of these, you have to use Nintex Regular Expression action, configured for an Extract.

To get the text for the src attribute you use this:
(?<=src=”)[\w/.-0-9%]+(?=”)

To get the text for the href attribute you use this:
(?<=href=”)[\w/.-0-9%]+(?=”)

Extract only allows you to store the result in a Collection variable. So you would then need a Collection Operation action to Get the first value from the collection and store it in a text variable.

Sample configuration for the same given below

That’s it you are done. Thank you Vadim your idea helped me to solve this requirement.

Advertisements

About Joseph Velliah
As a SharePoint Developer my professional interests tend to be technical and SharePoint focused. I run a blog at "SP RIDER" where you can expect to read HOW TOs and scenarios that I run into during my day to day job. I hope my posts will give back a little to the community that is helped me.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: