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 User Group Member Badges

FIll out a quick form to claim your community user group member badge today!


New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,320)