as "accountNumber" in response data is empty string, then I think this action should use translationMapDefaults to set accountNumber as empty string as "". but it return integer
type with this error message : " ****Validate output against schema: JSON failed schema validation for the following reasons: Schema: # @/properties/accountNumber. Error location: /accountNumber. instance type (integer) does not match any allowed primitive type (allowed: ["string"])**".
how can return an array with empty string (like [""]) if response of "accountNumber" is empty string("") ?
I tested this out by putting the example json into mockable.io and hit a custom data action against it with the action configuration you provided. In seemed to work exactly as you wanted it to.
On the resolve translation map step
"accountNumber": "[\"\"]"
Apply output transformation
{
"accountNumber": ""
}
Final output:
{
"accountNumber": ""
}
One thing that I see that could be confusing is that there is one accountNumber in the json that you provided, which does have a value of "". However, that accountNumber is for an "agent" participant, so it is being ignored based on the translationMap looking for customers.
thanks for your reply, I'm still confusing how it was working, I have below question:
1, if "accountNumber" attribute not exist in "customer" participant ("accountNumber" attribute not defined in "customer" participant ), it will not use translationMapDefaults ?
2, if "accountNumber" attribute exist in "agent" participant, and the value of "accountNumber" attribute was "", then it will go to use translationMapDefaults, set the accountNumber = [""],
as using "successTemplateUtils.firstFromArray", so the output should be "" (string), in this case, should I set accountNumber as string or array ?
one more question : is there any way to track the log of this action ? I would like to know the response of each of this action to check whether it has conducted successfully or not.
1, if "accountNumber" attribute not exist in "customer" participant ("accountNumber" attribute not defined in "customer" participant ), it will not use translationMapDefaults ?
If there is no accountNumber attribute then it will use the translationMapDefault.
2, if "accountNumber" attribute exist in "agent" participant, and the value of "accountNumber" attribute was "", then it will go to use translationMapDefaults, set the accountNumber = [""],
as using "successTemplateUtils.firstFromArray", so the output should be "" (string), in this case, should I set accountNumber as string or array ?
Currently the account number of an agent would be ignored because of this part of your translationMap:
?(@.purpose=='customer')
For my testing I ended up on having accountNumber be a number. It shouldn't be an array as the firstFromArray function will return a single value.
is there any way to track the log of this action
Assuming that this data action is being used in an architect flow, you could put some logging into the different exit paths of the action. You could call a logging data action with the results, or put some sort of participant data into the conversation indicating what happened. We are working on making it possible to know statistics about success/failures of data actions, although that may not be detailed enough for what you want.
thanks for your reply.
as the "accountNumber" was input by customer, so I think I should get the "accountNumber" from customer purpose participate.
regarding to the json file I uploaded before, because there are no "accountNumber" in customer purpose participate, I though it should use translationMapDefaults to transfer the output, but it seems translationMap still output an empty array which you can check from "resolve translation map", so I think that .
if "accountNumber" attribute not exist in "customer" participant ("accountNumber" attribute not defined in "customer" participant ), it will not use translationMapDefaults
`.
so I doubt that it will never use translationMapDefaults if the output of translationMap is array no matter this array is empty or not ?
actually, exactly what I want is the list of this call action during today and the response of each action, for example in this case, the response would be "accountNumber".
I apologize for my slow response, and not being more clear in my previous message. There is no built-in logging data action, however it is pretty common for Genesys Cloud customers to create a logging data action to log out information to one of their systems.
Do you still have any additional questions / problems that I can assist with?
I know that several of our customers have setup an integration with data actions that will send "logs" to one of their systems. They then call that data action in their architect flows to update their system with what happened in the IVR. I don't have any guidance for this, I was just saying it was something that customers have done.