Update WF Attribute with a variable value from a WebReport

I'm looking to update a WF Attribute with a variable value from a WerbReport step, for example:

I have a WF attribute called "permission", and I want to update it with a variable called "hasPermissions" in a WebReport. I have tried the below but none is working.

let hasPermission = "false";
[LL_REPTAG_&hasPermission SETWFATTR:permission /];
[LL_REPTAG='hasPermission' SETWFATTR:permission/]

I have also tried to set up a condition for it, but the condition evaluation is not working, it always evaluates to the ELSE

[LL_WEBREPORT_IF 'hasPermissions' == "false" /]
[LL_REPTAG_"false" SETWFATTR:permission /];
[LL_WEBREPORT_ELSE /]
[LL_REPTAG_"true" SETWFATTR:permission /];
[LL_WEBREPORT_ENDIF /] 


Any clue on this would be very appreciated!

Tagged:

Best Answer

  • appuq
    appuq Member
    edited November 3 #2 Answer ✓

    The IF conditions needs to be a WR variable

    [LL_WEBREPORT_IF '[LL_REPTAG_!hasPermissions /]' == "false" /]

    the above line is basically checking if that dynamic variable has a string value equal to the value in the double quotes not a Boolean like you may need.

    add a WR and hit tag guide and then search the area if you look through that online example

     [LL_WEBREPORT_IF "[LL_REPTAG_TOTALROWS /]" >= "10" AND "[LL_REPTAG_&reptype /]" == "parmB"> /]...[LL_WEBREPORT_ENDIF /]

    Operators

    However you I think are trying to do based on something a WF value tells you like if a person has done or put something you want your WR step to do something for that try to model your logic in the WF without WR and I think you will get it. These are things that the OT WF community has been doing at least for about 25 years:)

    WR1 and WR2 is a good read if you can find it somewhere

Answers

  • Referencing a WeBReport variable is with [LL_REPTAG_!hasPermissions /]

    Debugging WR steps is WFs is done as best as follows:

    1. Assign the step to yourself, don't run it automatically.
    2. When you open the step from my assignments, you can run the webreport from the webreport tab.
    3. Put enough output in you webreport to understand what is happening.
    4. Change the webreport to fix things.
    5. rerun the webreport again. continue with step 4.

  • what is this notation ?

    let hasPermission = "false";

    that looks like Javascript WR variables are not initialized like that look for simple examples

    if you were the step recipient and you never had the WR step it would show up in your assignments correct ? can you cahnge it if so the WR will also be abl eto change it.

  • Hello @appuq,
    Many thanks for your reply.

    We are just having a variable that has a value of some logic, whether it is "true"/"false", we want to map this variable value to a reptag value or to the workflow attribute.

  • unfortunately, if you do that it wont mean nothing and most likely since the output is HTML it may print that as Hans told you you have to set something yourself correctly

    a quick example haven't put it to a WF step but ,

    [/* Title: Blank Reportview */]
    <br>[LL_REPTAG_"false"  SETVAR:hasPermissions /]

    value of hasPermissions when this line executed is [LL_REPTAG_!hasPermissions /] <br> [LL_REPTAG_"true" SETVAR:hasPermissions /]

    value of hasPermissions when this line executed is [LL_REPTAG_!hasPermissions /] [LL_WEBREPORT_STARTROW /]
    This will Print only if the WR has a source
    [LL_WEBREPORT_ENDROW /]

  • Hello @appuq,
    Many thanks for your reply.

    Understood, but is it possible to set up the condition based on the variable?

    For example, check if the variable 'hasPermissions' == "false"?

    [LL_WEBREPORT_IF 'hasPermissions' == "false" /]

  • appuq
    appuq Member
    edited November 3 #9 Answer ✓

    The IF conditions needs to be a WR variable

    [LL_WEBREPORT_IF '[LL_REPTAG_!hasPermissions /]' == "false" /]

    the above line is basically checking if that dynamic variable has a string value equal to the value in the double quotes not a Boolean like you may need.

    add a WR and hit tag guide and then search the area if you look through that online example

     [LL_WEBREPORT_IF "[LL_REPTAG_TOTALROWS /]" >= "10" AND "[LL_REPTAG_&reptype /]" == "parmB"> /]...[LL_WEBREPORT_ENDIF /]

    Operators

    However you I think are trying to do based on something a WF value tells you like if a person has done or put something you want your WR step to do something for that try to model your logic in the WF without WR and I think you will get it. These are things that the OT WF community has been doing at least for about 25 years:)

    WR1 and WR2 is a good read if you can find it somewhere