Data360 Analyze

 View Only
  • 1.  HTTP Header

    Posted 03-08-2023 06:03
    Edited by Dhinmar James Cayog 03-08-2023 06:35

    Hi,

    Can you please guide me how can I convert this from Header to Header (from Field)? It is working using Header option but I need to use Header (from Field) to make the value dynamic which is needed on another http node.

    Header:

    client_id: a1b2c3
    client_secret: d4e5f6

    I tried to do it like below but it does not work.

    From Transformation Node:

    Configure:

    out1.client_id = str
    out1.client_secret = str

    Process:

    out1.client_id ="client_id: a1b2c3"
    out1.client_secret ="client_secret: d4e5f6"

    HTTP Node:



    ------------------------------
    Dhinmar James Cayog
    Knowledge Community Shared Account
    ------------------------------



  • 2.  RE: HTTP Header
    Best Answer

    Employee
    Posted 03-09-2023 10:07

    Hi Dhinmar,

    Short Answer:

    The "(from Field)" option only can pull the value from one field, not more than one.  What you are doing requires replacing the values in the text you provide and I have been using replace() to do that sort of thing.

    Details part 1

    I put the code you supply in your question into a Generate Data node.  Then I used a Transform node to create the header field value with the following code:

    out1 += in1
    out1.myheader = in1.client_id + "\n" + in1.client_secret
    

    Then in the HTTP node you can use "Header (from Field)" like this:

    Detail part 2:

    I have been following the following pattern a lot lately to do what I think you are wanting to be able to do:

    Use a "Input Static" node that defines the structure of the data you want in the output.  It has place holders for the data that comes from the input.

    The Transform node simply uses replace() to plug the input data into the form like this:

    The resulting output is:

    Ernest



    ------------------------------
    Ernest Jones
    Precisely Software Inc.
    PEARL RIVER NY
    ------------------------------



  • 3.  RE: HTTP Header

    Posted 03-22-2023 12:22

    Hi Ernest, Thank you very much!



    ------------------------------
    Dhinmar James Cayog
    Knowledge Community Shared Account
    ------------------------------