HanumanthaRao_Muvva | 2024-08-16 09:21:50 UTC | #1
Hello folks,
I am looking to fetch last agent participant id from conversationId. Below topic helped, however it is not working when we have two agent participant ids.
example: when a customer replied to advisor response and it answered by other advisor, we will have two agent participant Ids.
$.participants[?(@.purpose=="agent")].id this condition results in
[ "pId1", "pId2" ]
when I am trying to use $.participants[?(@.purpose=="agent")].id[0] or similar expressions, no luck in that
@anon28066628 any guess from your side.
Thanks in Adavnce
Write data to an interaction note - Genesys Cloud Applications - Genesys Cloud Developer Forum
zubair | 2024-08-16 10:55:41 UTC | #2
Hi
You can extrat the last agent participant from output array in architect
HanumanthaRao_Muvva | 2024-08-16 11:11:49 UTC | #3
Hi Zubair, Thanks for your response. could you help me with an example to understand.
I am trying to extract script attributes set by agent and update those attributes data in wrapup notes.
I am using /api/v2/conversations/emails/${input.conversationId} -- to fetch last agent pid and attributes, and using /api/v2/conversations/emails/${input.conversationId}/participants/${input.participantId} to update wrapup notes
zubair | 2024-08-16 12:17:50 UTC | #4
Lets say in architect you map the data action output to Task.prtcpIds
To extract the last id, use the update data block, define a string variable and set below expression as value
GetAt(Task.prtcpIds, Count(Task.prtcpIds) - 1)
HanumanthaRao_Muvva | 2024-08-21 06:42:00 UTC | #5
hi @zubair
Thank you !
system | 2024-09-21 06:42:38 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 27936