Unable to reference Web Service call response in subsequent workflow step
I'm calling an API that returns
{"yourDate": ["2023-12-11"]}
and is stored in a collection called responseBody in my first Web Service Method. My second Web Service Method has a parameter called endOfDuty of type String whose source is From Workflow, but I haven't been able to build the correct Source Property reference to the yourDate of responseBody to be able to get any value into the endOfDuty string.
I've referenced KBA 148498 and question 122375, without any luck. How can I get the date string out of the API response into that string??
Asked by Scott Williamson
on Tue 12/12/23 9:58 PM
Our Sandbox/IT Tickets app: https://tulsalibrary.teamdynamix.com/SBTDAdmin/BE/AppInstances/Details.aspx?ID=103
- Scott Williamson
Wed 12/13/23 12:39 PM
Sign In to leave feedback or contribute an answer
Answer (1)
This answer has been marked as the accepted answer
Mark Sayers
Wed 12/13/23 10:04 AM
Hello Scott,
How is your parameter's Source Value being defined currently?
Sincerely,
Mark Sayers
Sr Support Consultant, CS
No feedback
I've tried the each of the names with index numbers in different positions -
responseBody.yourDate
responseBody[0].yourDate
responseBody.yourDate[0]
responseBody.[0].yourDate (KBA 148498)
responseBody[0].yourDate[0]
Whatever the permutation, the endOfDuty string turns out to be empty. - Scott Williamson Wed 12/13/23 11:29 AM
responseBody.yourDate
responseBody[0].yourDate
responseBody.yourDate[0]
responseBody.[0].yourDate (KBA 148498)
responseBody[0].yourDate[0]
Whatever the permutation, the endOfDuty string turns out to be empty. - Scott Williamson Wed 12/13/23 11:29 AM
Ok, I assume the system you are calling out to to get that date is some external API? Is what you listed in this question's body the full response it sends back to you?
- Mark Sayers
Wed 12/13/23 11:48 AM
Here are the log contents:
1st call)
The server returned "200 OK".
Response Body:
{"yourDate": ["2023-10-01"]}
2nd call - continued in next comment)
The server returned "201 Created".
Request Body:
{
"TicketID": 602377,
"Title": "endOfDuty - ",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
}
"Response Body":{
"ID":109520,
"TicketID":602377,
"Title":"endOfDuty - ",
"Description":"Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"IsActive":true,
"NotifyResponsible":true,
"StartDate":null,
"EndDate":null,
"CompleteWithinMinutes":null,
"EstimatedMinutes":0,
"ActualMinutes":0,
"PercentComplete":0,
"CreatedDate":"2023-12-13T16:20:38.267Z",
"CreatedUid":"700394c3-4dfa-ed11-800f-0050f2f473d0",
"CreatedFullName":"TDX Webservice" - Scott Williamson Wed 12/13/23 12:23 PM
1st call)
The server returned "200 OK".
Response Body:
{"yourDate": ["2023-10-01"]}
2nd call - continued in next comment)
The server returned "201 Created".
Request Body:
{
"TicketID": 602377,
"Title": "endOfDuty - ",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
}
"Response Body":{
"ID":109520,
"TicketID":602377,
"Title":"endOfDuty - ",
"Description":"Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"IsActive":true,
"NotifyResponsible":true,
"StartDate":null,
"EndDate":null,
"CompleteWithinMinutes":null,
"EstimatedMinutes":0,
"ActualMinutes":0,
"PercentComplete":0,
"CreatedDate":"2023-12-13T16:20:38.267Z",
"CreatedUid":"700394c3-4dfa-ed11-800f-0050f2f473d0",
"CreatedFullName":"TDX Webservice" - Scott Williamson Wed 12/13/23 12:23 PM
2 continued)
"CreatedFullName":"TDX Webservice",
"CreatedEmail":"",
"ModifiedDate":"2023-12-13T16:20:38.267Z",
"ModifiedUid":"700394c3-4dfa-ed11-800f-0050f2f473d0",
"ModifiedFullName":"TDX Webservice",
"CompletedDate":"0001-01-01T00:00:00",
"CompletedUid":null,
"CompletedFullName":"",
"ResponsibleUid":null,
"ResponsibleFullName":"",
"ResponsibleEmail":"",
"ResponsibleGroupID":2181,
"ResponsibleGroupName":"TDX Test",
"PredecessorID":0,
"PredecessorTitle":"",
"Order":10,
"TypeID":1,
"DetectedConflictCount":0,
"DetectedConflictTypes":0,
"LastConflictScanDateUtc":"0001-01-01T00:00:00Z",
"Uri":"api/103/tickets/602377/tasks/109520"
} - Scott Williamson Wed 12/13/23 12:24 PM
"CreatedFullName":"TDX Webservice",
"CreatedEmail":"",
"ModifiedDate":"2023-12-13T16:20:38.267Z",
"ModifiedUid":"700394c3-4dfa-ed11-800f-0050f2f473d0",
"ModifiedFullName":"TDX Webservice",
"CompletedDate":"0001-01-01T00:00:00",
"CompletedUid":null,
"CompletedFullName":"",
"ResponsibleUid":null,
"ResponsibleFullName":"",
"ResponsibleEmail":"",
"ResponsibleGroupID":2181,
"ResponsibleGroupName":"TDX Test",
"PredecessorID":0,
"PredecessorTitle":"",
"Order":10,
"TypeID":1,
"DetectedConflictCount":0,
"DetectedConflictTypes":0,
"LastConflictScanDateUtc":"0001-01-01T00:00:00Z",
"Uri":"api/103/tickets/602377/tasks/109520"
} - Scott Williamson Wed 12/13/23 12:24 PM
Our Sandbox/IT Tickets app: https://tulsalibrary.teamdynamix.com/SBTDAdmin/BE/AppInstances/Details.aspx?ID=103
- Scott Williamson
Wed 12/13/23 12:41 PM
Hmm, have you tried it like so yet for the parameter source value: responseBody.yourDate.[0]
This just notably has a period after the YourDate property name. I don't know if that will make a difference, but give that a test, then if it doesn't succeed we might have you submit a ticket so we can escalate this to an engineering resource to look into it. - Mark Sayers Wed 12/13/23 12:58 PM
This just notably has a period after the YourDate property name. I don't know if that will make a difference, but give that a test, then if it doesn't succeed we might have you submit a ticket so we can escalate this to an engineering resource to look into it. - Mark Sayers Wed 12/13/23 12:58 PM
I tried pulling responseBody.yourDate.[0] into my endOfDuty string and it didn't work. Using this as the web service method's body:
{
"TicketID": {{id}},
"Title": "endOfDuty - {{endOfDuty}}",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
}
The server returned "201 Created".
Request Body:
{
"TicketID": 602377,
"Title": "endOfDuty - ",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
} - Scott Williamson Wed 12/13/23 1:26 PM
{
"TicketID": {{id}},
"Title": "endOfDuty - {{endOfDuty}}",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
}
The server returned "201 Created".
Request Body:
{
"TicketID": 602377,
"Title": "endOfDuty - ",
"Description": "Temporary Duties have ended. Need to change AD permissions back to original for this employee.",
"EstimatedMinutes": "0",
"ResponsibleGroupID": "2181",
"ResponsibleGroupName": "TDX Test",
"TypeID": "1",
} - Scott Williamson Wed 12/13/23 1:26 PM
It looks like your workflow is configured such that the "Convert Date" step that is getting this date value is not connected to the next step which is your "Create ad task" step. Try connecting the convert step to the create ad task step so it *must* be executed first before the second step can be executed, then see what happens.
- Mark Sayers
Wed 12/13/23 1:52 PM
Ok. It works now..
That's strange. I linked them when I created the new step but then I noticed that it wasn't linked yesterday while I was testing - and - I remember specifically linking those steps and checking that workflow back in.
Thanks for your help with this. - Scott Williamson Wed 12/13/23 5:48 PM
That's strange. I linked them when I created the new step but then I noticed that it wasn't linked yesterday while I was testing - and - I remember specifically linking those steps and checking that workflow back in.
Thanks for your help with this. - Scott Williamson Wed 12/13/23 5:48 PM