Graph name as Parameter in Designer

Answered

Comments (3)

  • Avatar
    admin
    Hi Paul,

    As I understand it, you would like to use a graph name and write it to a field using CTL transformation. To do that, you might find the following code useful:

    string GraphFile = getParamValue("GRAPH_FILE");
    $out.0.field1 = GraphFile;


    This piece of code will write graph file identification to the output in the following form:
    graph/graphname.grf
    The "graph" states for Graph directory in the project path. If you don't want that extra part to be there, you might want to use some string functions such as split. Example:

    string GraphFile = getParamValue("GRAPH_FILE");
    string [] GraphName = split(GraphFile, "/");
    $out.0.field1 = GraphName[1];


    For more information about the function itself or other options, please see the documentation page String Functions.

    Please let me know if this doesn't answer your question or if any follow-up question arises. Thanks, Eva
    0
    Comment actions Permalink
  • Avatar
    pfield
    Thanks Eva!

    That's exactly what I needed. I did not see the GRAPH_FILE parameter listed in workspace.prm - is there a place all the parameters available are documented?

    Kind Regards,
    Paul
    0
    Comment actions Permalink
  • Avatar
    admin
    Hi Paul,

    The parameters available are indeed listed in the documentation (https://doc.cloverdx.com/latest/server/graph-parameters.html). However, please don't get confused that the link is from Server-related documentation. These parameters are used in the Designer runtime as well.

    You might have also noticed, that the previously mentioned parameter GRAPH_FILE is not listed on the above-mentioned page. Recently I have been informed that this parameter is about to be deprecated soon and we should be using JOB_FILE parameter instead. Doing so in a graph (.grf design) will behave the same way as the GRAPH_FILE parameter.

    Thanks for understanding. Have a nice day, Eva
    0
    Comment actions Permalink

Please sign in to leave a comment.