Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

How can I create and use a hash

Pretty new to this and finding online documentation wanting.  I built the sample translator app from this tutorial:


One frustrating thing about the translate api is that it can list language names, but the translate methods require translate codes. I though I would improve the app by displaying the language names (more human friendly) in the drop down and use that to look up the language code before calling the translation methods.


I tried to do this by trying to creating a collection upon my page becoming visible that allows me to lookup a code from a name. My "onVisible" code is this:


If(!loadedonce, ClearCollect(langs, Table({Names:MicrosoftTranslator.Languages().Name, Codes:MicrosoftTranslator.Languages().Code}));UpdateContext({loadedonce: true}))


It seems to create the collection but my attempts to use lookup on this are failing. In attempting to debug I thought I would just try to show data from the collection in a text box, but I can't even do that. 


My formula for the Text property was "LookUp(langs,Names= ToLanguage.Selected.Value,Codes) " and it is complaining that it is not returning text.


Tips or suggestions welcome!

Community Support
Community Support

Re: How can I create and use a hash

Hi Don,


Have you seen this documentation about Microsoft Translator:
And also this documentation about Lookup function for your reference:


Please provide me more information about your scenario for better understanding. I am trying to find out a way to achieve what you want, and my understanding is that you want to translate based on the language names but not on codes, but the translate methods require codes but not names. If I misunderstand you, please feel free correct me.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regular Visitor

Re: How can I create and use a hash

I read the material and tried to use it (per code samples I included in my original request for help).  Be aware - I am using this as a simple learning assignment. I don't really care about translation per se.


So I thought it would be reasonable to try to load language codes and language names to a table, and use lookup to map one to the other.  There is something wrong with my approach becasue lookup fails. I find the documentation inadequate for solving real world problems. I understand how to create a table of ice cream flavors using hard coded records. I am having trouble using the return of a translate method into a table I can subsequently use.

Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,982)