looking for guidance on what I’m doing wrong with the workflow.
The workflow is retrieving a list of identities from a search query.
I’m then doing a loop to send an email about each identity.
The email body is not reporting the actual value.
I receive the expected eight emails that match the search query.
below is the output in the email
Debug info: Identity: $.loop.loopInput Name: ${identity.name} Display Name: ${identity.displayName} Username: ${identity.uid} The AD account for ${identity.name} will expire in 7 days. Please extend the expiration date if needed.
{
"id": "ad4b11b6-8704-4f3a-d1bc",
"name": "Copy of AD Account Expiration Check and Notification 2",
"description": "Checks AD account expiration date and notifies manager if within 7 days",
"created": "2025-06-25T20:51:19.69421315Z",
"modified": "2025-06-26T00:18:18.746904808Z",
"modifiedBy": {
"type": "IDENTITY",
"id": "dadd5b7a96a084635a",
"name": "Fred"
},
"definition": {
"start": "Get List of Identities",
"steps": {
"End Step - Success": {
"actionId": "sp:operator-success",
"displayName": "",
"type": "success"
},
"Get List of Identities": {
"actionId": "sp:get-identities",
"attributes": {
"inputQuery": "attributes.lcsExpiresin7days:true AND attributes.userType:Non-Employee",
"inputSavedSearch": null,
"searchBy": "searchQuery"
},
"description": null,
"displayName": "",
"nextStep": "Loop",
"type": "action",
"versionNumber": 2
},
"Loop": {
"actionId": "sp:loop:iterator",
"attributes": {
"context.$": "$.loop.loopInput",
"input.$": "$.getListOfIdentities.identities",
"start": "Send Email",
"steps": {
"End Step - Success 1": {
"actionId": "sp:operator-success",
"displayName": "",
"type": "success"
},
"Send Email": {
"actionId": "sp:send-email",
"attributes": {
"body": "Debug info: \n\nIdentity: ${identity}\n\nName: ${identity.name}\n\nDisplay Name: ${identity.displayName}\n\nUsername: ${identity.uid}\n\nThe AD account for ${identity.name} will expire in 7 days. Please extend the expiration date if needed.",
"context": {
"identity": "$.loop.loopInput"
},
"from": "",
"recipientEmailList": [
"[email protected]"
],
"replyTo": "",
"subject": "AD Account Expiration Notice - Debug"
},
"displayName": "Send Notification to Manager",
"nextStep": "End Step - Success 1",
"type": "action",
"versionNumber": 2
}
}
},
"displayName": "",
"nextStep": "End Step - Success",
"type": "action",
"versionNumber": 1
}
}
},
"enabled": false,
"executionCount": 0,
"failureCount": 0,
"creator": {
"type": "IDENTITY",
"id": "dadd5b7a96a044635a",
"name": "name"
},
"owner": {
"type": "IDENTITY",
"id": "96a0467f8c87f418b484635a",
"name": "name"
},
"trigger": {
"type": "SCHEDULED",
"attributes": {
"cronString": "0 17 * * *",
"dailyTimes": [
"1969-12-31T22:00:00.000Z"
],
"frequency": "daily",
"id": "idn:cron-schedule",
"timeZone": "EST"
}
}
}