Workflows - How to use account attributes in define variable

I am having a terrible time trying to use an account attribute to define a variable.

Specifically, I am trying to create an ITSM ticket to have the manager of a non-employee certify that the account is still needed or not. There is an attribute on the non-employee account called duration that is the number of months that the manager initially requested for them. We would like to use that number to suggest a new end date. I thought I could pull the attribute with the following string $.getAccounts.accounts[?(@.sourceId==‘2c9180868019802901801f59b5ef1c7d’)].attributes.duration

Upon a workflow test this error repeats many times.

    "errorMessage": "child workflow execution error (type: sp-child-workflow, workflowID: 5100308a-22c2-4be8-ba0c-cabd600fcb81-1, runID: 4b87f001-b68c-4921-b2e0-cd6b5eab112b, initiatedEventID: 23, startedEventID: 24): task failed: activity error (type: sp:internal:operator:mutative, scheduledEventID: 23

Thank you.

Hi James,

The expression:$.getAccounts.accounts[?(@.sourceId==‘2c9180868019802901801f59b5ef1c7d’)].attributes.duration to fetch the account attribute is correct. I have tried a similar one and it works for me. Just two things to ensure here:

  1. The value fetched in variableA i.e. identity attribute endDate is a date (not a string) in IS8601 format. (YYY-MM-DD “T” hh:mm:ss.SSSZ)
  2. The value fetched from account attribute duration is a number/integer, not a string.

Thanks,
Shailee

1 Like

Ah, the duration field is a string! That must be the issue then. Is there any way I can transform that value to a number/integer from string other than changing the account schema?

1 Like

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