I am working with excel having indian names in kruti dev and indic. I want to Transliterate from hindi to english by ui path. I have microsoft translator API. Please someone share full steps including Transliteration activity field.
DataTable inputDataTable = DT
DataTable outputDataTable = DT1
outputDataTable.Columns.Add(“Transliterated Name”);
foreach (DataRow row in inputDataTable.Rows)
{
string hindiName = row["A"].ToString()
string transliteratedName = new string(hindiName
.Select(c => transliterationMap.ContainsKey(c.ToString()) ? transliterationMap[c.ToString()] : c)
.ToArray());
outputDataTable.Rows.Add(transliteratedName);
}
Please share more details.
To transliterate Indian names from Hindi (Kruti Dev or Indic script) to English using UiPath and the Microsoft Translator API, you can follow these steps. We’ll use the “HTTP Request” activity to interact with the Microsoft Translator API for transliteration:
Step 1: Set Up Microsoft Translator API
- Make sure you have access to the Microsoft Translator API. You might need to sign up for a subscription and get the necessary API keys. Follow Microsoft’s documentation for API setup.
Step 2: Create Your UiPath Workflow
Here’s a step-by-step guide to creating your UiPath workflow:
- Open UiPath Studio and create a new workflow.
- Drag and drop an “HTTP Request” activity onto your workflow.
- In the “HTTP Request” activity properties:
- Set the “Method” to “POST.”
- Set the “Endpoint” to the Microsoft Translator API endpoint, which should include the transliteration feature. It might look something like this:
arduinoCopy code
https://api.cognitive.microsofttranslator.com/transliterate?api-version=3.0
- Add the following headers:
- “Ocp-Apim-Subscription-Key” (with your API key).
- “Content-Type” with the value “application/json”.
- In the “Content” field, provide the JSON request body. The body should contain the text you want to transliterate, the source language, and the target language. For example:
jsonCopy code
{
"text": "आपका नाम क्या है",
"from": "hi",
"to": "en",
"transliterationScript": "Latn"
}
- Make sure to replace the example text with the Hindi text you want to transliterate.
- Add an “Assign” activity to extract the transliterated text from the API response. For example:
vbnetCopy code
transliteratedText = responseContent("text")
- Use the “transliteratedText” variable as needed in your automation.
Step 3: Handling the Response
- After making the HTTP request and extracting the transliterated text, you can use the UiPath activities to further process or save the transliterated names as needed in your Excel file or any other destination.
- Ensure proper error handling and validation of the API response.
Please note that you need to set up the API correctly, including obtaining the necessary API keys and understanding the usage and pricing terms of the Microsoft Translator API. Additionally, you should follow best practices in your automation to ensure the security and reliability of your workflow.
This is the full steps of your solution. It take some to write.
Enjoy the solution
![]()
Thanks for the help. Now I have translated the documents. But i want to write in excel, but string cannont be written in data table. How to write this data in excel.
Please use ADD DATA ROW so it will add the string to the data table.
Please check in Youtube how to use add row activity