ZIS flow transform question - transform value to be Null | Community
Skip to main content

ZIS flow transform question - transform value to be Null

  • November 1, 2023
  • 1 reply
  • 0 views

Hello, I have a use case where the ZIS flow goes into a certain state and then needs to change an already initialized value. I am having a hard time finding documentation on how to change a value using a transform action. Is this possible?

"modifyValue": {
       "Type": "Action",
        "ActionName": "zis:common:transform:Jq",
        "Parameters": {
           "data.$": "$.data",
            "expr": ' < expression to modify value to an empty string or Null >'
           },
            "ResultPath": "$.ChangedData",
            "Next": "nextAction"
 },

 

Thanks

1 reply

Greg29
  • November 2, 2023

Hi Craig! I'm thinking that you might be able to do this by using the `gsub` command, along with the appropriate regex. I haven't done much with ZIS myself, so I might be off on this, but something like this might do it for you (changes in bold):

"modifyValue": {
       "Type": "Action",
        "ActionName": "zis:common:transform:Jq",
        "Parameters": {
           "data.$": "$.data",
          "expr": '.something | jq 'gsub("^(?!\s*$).+"; "")''
           },
            "ResultPath": "$.ChangedData",
            "Next": "nextAction"
},

With the combination of ZIS and regex, I can't say for sure that this will work, but let me know how this goes for you!