Ad Widget

Collapse

Brackets in Calculated Items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CyberJacob
    Junior Member
    • Sep 2017
    • 1

    #1

    Brackets in Calculated Items

    I have several items that I'm trying to combine for a trigger, and am using a calculated item to handle some of the processing. One of the items stores the last time a process ran:

    Code:
    system.run[powershell -c "(curl x://xxx/api/a/{#ID} -Method POST -UseBasicParsing -Body @{key='xxx'}).Content", wait]
    And another contains the maximum acceptable delay:

    Code:
    system.run[powershell -c "(curl x://xxx/api/b/{#ID} -Method POST -UseBasicParsing -Body @{key='xxx'}).Content", wait]
    I am then trying to combine these using the following formula:

    Code:
    fuzzytime(system.run[powershell -c "(curl x://xxx/api/a/{#ID} -Method POST -UseBasicParsing -Body @{key='xxx'}).Content", wait]",last(system.run[powershell -c "(curl x://xxx/api/b/{#ID} -Method POST -UseBasicParsing -Body @{key='xxx'}).Content", wait], 0))
    However, I cannot find a combination of backslashes to escape the key that does not cut off the ").Content..." on each one. Is it possible to escape brackets in a calculated item formula?

    For reference, the error I'm getting is as follows:

    Code:
    Cannot evaluate function "fuzzytime()": item "x:
    "system.run[powershell -c "(curl x://xxx/api/a/{#ID} -Method POST -UseBasicParsing -Body @{key='xxx'}" does not exist.
    Thanks
Working...