Workflow creation and problem with loop and possible workaround

Hello everyone, I’m trying to build a costum request for others in which I can select multiple access items and based on the number of these access item i want to trigger an interactive form to set up a sunset date for each of these access item. To achieve this requirement I’m implementing a workflow with a loop. the loop is iterating over the array of the access items and inside the loop i’m calling the interacting form that I built for requesting for each access item the sunset date:


the problem is that when executing the workflow, i’m receiving this error:

{
  "loopOutput": {
    "failureItems": [
      {
        "errorMessage": "task failed: activity error (type: sp:interactive-form:send-form-block, scheduledEventID: 5, startedEventID: 6, identity: 1@sp-workflow-worker-stg-eu-central-1-5cffff5b96-7gd5m@sp-workflow-engine): infra.completeInteractiveProcessActivity: interactive action used with out interactive trigger (type: Error Parsing Input, retryable: false): infra.completeInteractiveProcessActivity: interactive action used with out interactive trigger (type: fundamental, retryable: true)",
        "payload": null
      }
    ],
    "successfulItems": []
  }
}

it looks like that I can’t insert an interactive form inside the loop. So I’m looking for a fix or a workaround. the workaround would be to determine the number of access items requested in the “select access item” block and than call an interactive form that is able to display the selection of the right number of sunset date based on that number. The point is, how I can retrieve the size of the selected access item?

@s_tartaglione

To get the size of the access Items , you can call :
$.selectAccessItemVariableName.length() : this returns an Integer value of the size of the array .

it is returning the size not of the array , but the number of letter of the access item

Try : $.selectAccessItemVariableName[*].length()
and , Can u send your workflow , mask sensitive data

Sorry i can’t sent it, but the result is now: { "id": "sp:define-variable", "variables": [ { "description": "", "name": "numOfAccessProfiles", "transforms": [], "variableA": [ 32, 32 ] } ] }

It seems like is counting the number of words of each access item

What I can think of is to have a second Workflow that will be triggered for each access item inside the loop. Then the interactive form is created and required actions carried out from the second workflow

1 Like

No problem .
I would like to see what is the source of the action select access item , is it an array of values or not .

yes, it is an array, in fact if i put $.selectedAccessItem[*] i have:

{
  "id": "sp:define-variable",
  "variables": [
    {
      "description": "",
      "name": "numOfAccessProfiles",
      "transforms": [],
      "variableA": [
        "2bccdb3e6e974397b7abc5216896e249",
        "6ce669838aff4dd78ec7fb29e98f1422"
      ]
    }
  ]
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.