Workflow Soluiton

 View Only
  • 1.  Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 17, 2013 09:18 AM

    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



  • 2.  RE: Insert a hyperlink into an existing set of data then display in a grid



  • 3.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 18, 2013 03:57 PM

    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



  • 4.  RE: Insert a hyperlink into an existing set of data then display in a grid
    Best Answer

    Posted Nov 19, 2013 10:12 AM

    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



  • 5.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 20, 2013 01:23 PM

    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.



  • 6.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 20, 2013 01:31 PM

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



  • 7.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 20, 2013 01:41 PM

    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.

     

     

            



  • 8.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 20, 2013 05:37 PM

    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.



  • 9.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 22, 2013 02:49 PM

    Thanks Michael.George. That was the ticket.



  • 10.  RE: Insert a hyperlink into an existing set of data then display in a grid

    Posted Nov 22, 2013 02:52 PM

    No problem. Pay it forward, eh?