Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

Insert a hyperlink into an existing set of data then display in a grid

Created: 17 Nov 2013 • Updated: 20 Nov 2013 | 9 comments
This issue has been solved. See solution.

Hi Everyone,

Here is my scenario. I have an array of data, this data represents all of the purchase orders which an individual has to approve. These are presented to the user in a data grid within a web form. The user then selects each of the po's they would like to approve, clicks the button on the form and the po number for each selected po is passed to a custom component which performs the appropriate action in the database, this part is working. 

The following is the functionality I would like to add to this process.

Each of these po's has a corresponding PDF file stored on the server. I would like the user to be able to pull up each PDF, by clicking on a hyperlink which will also be displayed in the grid as well, this is the part I am looking for help on.

The file path to the PDF file is comprised of a fixed path which then needs  to be combined with the JobNumber and PoNumber variable from my existing data stream to combine for a completed clickable file path, displayed in the data grid, which is unique to each record.

the path would need to look like.......

     \documents\jobnumber\jobnumber_ponumber.pdf (where JobNumber and PoNumber are the variables pulled from withing the existing set of data)

I do have existing data fields in my data array which are not used, so I do have the option to be able to "hijack" one of these existing fields, strip out any data it may contain and insert my newly created file path hyperlink as opposed to inserting a new data field into the existing array. But any option would be acceptable. 

I am using workflow 7.5

thanks in advance for the help on this.

Steve

Operating Systems:

Comments 9 CommentsJump to latest comment

scava's picture

Hi Reecardo,

 

I have gone through the post you referenced. I think my problem is how i am using a for each and merge text components to acheive what i am looking for.

 

Could you give me a detailed explanation as to how to use these two components to accomplish this.

 

Thanks

 

Steve

michael.george's picture

You should be using the for each component after you have retrieved your data as an array. In most of my cases, that means using a custom sql component, but depending on what you are actually doing, there are a lot of ways you could end up with this array of data. Once you have it, put the for each component inline and it will give you a next element path.

Screen Shot 2013-11-19 at 7.56.51 AM.png

Obviously, this screen shot has more going on, but you can see the overall flow of things.

From that, run it into a merge text component that builds an html link. This should look something like:

<a href='whateveryouarelinkingtoo'>Text to display</a>

As is mentioned in the other thread that reecardo linked, if you are linking to a page outside your workflow, you need to include the full url, including the http:// or https:// prefix. The output variable of this component should be saved into a variable in the element you are reading in. In many cases, I'm just overwriting a field that I just pulled data from, but that's okay because it isn't writing it back to the database.

Screen Shot 2013-11-19 at 7.58.13 AM.png

Connect the output of the merge text component back into the for each component so that this same process will happen to each item in your array.

Connect the finished outcome of the for each component to a form builder component and display whatever you need. Note in the screenshot below that I had previously stored my link as the PONumber field and I am now displaying it in a grid component. When this is viewed in a browser, it will be a clickable link.

Screen Shot 2013-11-19 at 8.09.52 AM.png

If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.

SOLUTION
scava's picture

Thanks to all for the responses... this worked. I still have an issue with my For Each loop... it is not getting past the first item in the list, if anyone has any idea why, please let me know.

michael.george's picture

From your merge text component, you are then flowing back into the for each component, right?

If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.

scava's picture

Yep... I have attached images of the project, my for/each settings and my merge text settings.

Note that in the merge text settings, my names have a [first] in them, i suspect this is why it is only hitting the first item in the list but I do not have any other choices available to me.

 

 

        

overall project.jpg foreach settings.jpg merge settings.jpg
michael.george's picture

I think I see what's happening. It looks like you have a custom component retrieving your data. That's going to be returned as a complex data type (name entered when you compiled the component). Instead of setting your for each component to use the GetPOsBySuperintendentResult[*] variable on the data type text, you should set it to use the variable GetPOsBySuperintendentResult using whatever the appropriate data type is (you can right click on the for each and click on browse data, then check show type names to see the data type name).

Once you've done that, set your merge text component to be working with your for each output variable of "DocID" instead of the GetPOsBySuperintendentResult[first] variable.

Screen Shot 2013-11-20 at 3.35.22 PM.png Screen Shot 2013-11-20 at 3.35.32 PM.png Screen Shot 2013-11-20 at 3.35.42 PM.png

If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.

michael.george's picture

No problem. Pay it forward, eh?

If a post solves your issue, please mark it as a solution. It makes these forums better for everyone.