Custom Dynamic Translation Configuration

PJBNascimento
Tera Expert

I am working on a POC to create a custom Translator Configuration to use in Dynamic Translation.
Since I can't test any of the OOTB integrations (Microsoft Azure Translator Service Spoke for example) because I don't have a valid API key for any of these services, I can't see these subflows running successfully, view the actual values that are sent as input to the subflow and then see what is sent as output from the subflow. And since the documentation is very limited in this regard, it is quite difficult to implement something successfully.

Instead of starting from scratch, I decided to copy one of the OOTB subflows and try to replicate it as much as possible.

I created a subflow that uses Open AI and receives exactly what Microsoft's OOTB spoke receives, but I can't be sure if the output of my subflow is exactly the same as what the OOTB subflow returns (this is because, as I said above, I can't test the OOTB subflow because I don't have a valid API key for that service).

Image2 shows what my subflow is returning as output.

The subflow runs when I click on the Translate button > Image 1.
And this is due to the Translator Configuration I created > Image0.

 

The output of my subflow was built taking in consideration the documentation available here: https://www.servicenow.com/docs/r/platform-administration/dynamic-translation/integrate-translation-...

In summary, it seems to me that everything is more or less configured correctly, but I deduce that there is a problem with the output of my subflow, which probably does not have all the necessary information or it is not well formatted, and this causes the content that is being translated correctly by my subflow not to then be displayed in the UI.

Can anyone help?

1 ACCEPTED SOLUTION

PJBNascimento
Tera Expert

I finally managed to get Dynamic Translation working with a custom configuration/translation service provider other than the OOTB spokes.

My steps were:

  1. I cloned the "Translate Text" subflow from Microsoft Azure Translator Service Spoke
  2. I cloned the "Translate Text" action from Microsoft Azure Translator Service Spoke (which is step 4 of the subflow I mentioned above)
  3. In my custom subflow, which is the clone of "Translate Text" (point 1), I replaced the "Translate Text" action with the custom action, which is the clone of "Translate Text" (point 2)
  4. In my custom action, I left my action inputs and outputs exactly as they were, I just changed and added some script steps to call my custom/3rd party translation service API and then parse the response that comes from it and configure it as the OOTB action expects.
  5. In addition, I had to create a Translator Configuration record, which is marked as default for translation and calls the subflow that I cloned above.

If anyone has any doubt or issues, you can reply to this thread and I'll try to help you out.

View solution in original post

7 REPLIES 7

Mark Manders
Giga Patron

You created something completely custom and it doesn't work the same as OOB? With just a screenshot of the output (which is correct, if I understand you correctly), it is very hard to even start on what's not going as expected.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I don't know if it works exactly with the OOTB subflow. As I said, I've never been able to see the OOTB subflow running without errors because I don't have an API key, so it's difficult to know if the logic I implemented in my custom subflow is correct and sends exactly as output what the system expects to translate things using Dynamic Translation.

How do you expect us to know if your CUSTOM objects are configured correctly if you don't share anything about them? Please realize that we do not have access to your instance. Any questions about OOB can be answered. If you have questions or doubts on custom things you built yourself, you will need to share as much as you can about them.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

I showed exactly what my custom subflow is returning (image2), and I also said that it was a copy of the OOTB spoke for the Microsoft translator service, mentioning it has the same subflow inputs and outputs.

The logic in the middle of the subflow is different of course, because it makes a different call since it is to Open AI and not to Microsoft. There are also some scripts/JSON builders and parses to put the content as I think the OOTB logic needs.
My only question is whether what I am sending within the subflow outputs is really enough or not.
What I am asking is whether anyone has ever had to create a custom subflow for Dynamic Translator or has one of the OOTB subflows that can tell me whether what I am returning is 100% correct or not.