I have a mail flow that is calling a webservice, to receive intents from a mail body.
My idea was to create a loop and search for ACD skills, based on the intents. Finally I want add the skills to the "Transfer to ACD"-task. Is this technically possible?
I just had a look at this (as I had never tried).
So I would say partially yes...
From what I see, there is no way to specify/add skills via an API call (I mean a PureCloud Data Action).
The Skill can only be set in the Transfer to ACD action.
In the Transfer to ACD, you can specify an ACD Skill that would come from a variable. It cannot be an ACD Skill Collection (I mean setting a variable that holds an ACD Skill Collection).
So you could "dynamically" assign skills. But you would need to have one Transfer to ACD action per number of skills you are subject to set.
I mean if the possible cases are 0 skill, 1 skill, 2 skills (regardless of what the skill/skill name is), you would need to define one Transfer to ACD action with zero skills, one Transfer to ACD action with one skill (value coming from a variable you would define as an ACD Skill - like Flow.MySkill1), one Transfer to ACD action with two skills (Flow.MySkill1, Flow.MySkill2).
You could have a branch block before that would check how many skills you got and connect to the appropriate Transfer to ACD action.
Note: You can use the FindSkill function to assign a value to your ACD Skill variable (it takes the skill name as input parameter)
If the question is to dynamically add skills, without knowing how many upfront (I mean not managing the possible cases/numbers in the Architect flow), then I don't think there is a way to achieve this today.
I just tried the following in a chat flow and it seemed to work (didn't break).
I had 2 variables defined: Flow.MySkillCollection (as ACD Skill Collection) and Flow.MySkill (as ACD Skill).
In a first Update Data action, I did this (2 statements):
Flow.MySkillCollection -> MakeEmptyList(ToSkill(NOT_SET))
Flow.MySkill -> FindSkill("TestSkill1")
And then, in a second Update Data action, I did this:
Flow.MySkillCollection -> AddItem(Flow.MySkillCollection, Flow.MySkill)
I do not doubt, that this will work, but if I want to map a collection of strings to a collection of skills for further assignemt, I need to use a loop. Thats because I can't say if the intent I get is a skill or not.
But this don't seem to work. I'm not sure, if that behavior is maybe a bug.
A possible solution is to create a new action and filter all the intents that are not skills and use that list to search for skills without using loops. I will try that.
I did not mention the loop or your string collection not because I was saying you should not use it, but just because I only wanted to show MakeEmptyList(ToSkill(NOT_SET)) to set an empty list, and AddItem(Flow.MySkillCollection, Flow.MySkill) to add a skill to the skill collection.
As you mention that your string/intent may or may not correspond to a configured skill, you should then use the FindSkill action (the block, not the function). FindSkill action will have a Found and NotFound outputs.
You can then call the Flow.MySkillCollection -> AddItem(Flow.MySkillCollection, Task.MySkill) on the Found output (so that you only add valid skills to your collection).
"that is something for the idea portal"
Indeed. If you don't mind creating one if you have time one day, it'd be great. Was exchanging with PM who are interested to have this one tracked for future enhancements.