Fetching last agent participant ID

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

Hi

You can extrat the last agent participant from output array in architect

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

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)

1 Like

hi @zubair

Thank you !

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