cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RoopaPendyala
Level: Powered On

Get the value of the column value - data source excel.

I need to set a variable in OnVisible property of the screen to the column name of the excel table.

( Excel table column names are English, french, german etc).

 need to check the variable and get the actual value of the specified column and display in the lable text.

 

The excel table is something like this.

Column Name    Value

English               Hello

French               Bonjour

 

When I pass column name English in OnVisible property , The label should show Hello , if I pass French , the lable should show Bonjour.

can this happen dynamically ?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get the value of the column value - data source excel.

Hi @RoopaPendyala ,

Does your table look like this?

(Column Name)    English     French       

(Value)                   Hello      Bonjour

If so, 'English' and 'French' is column name.       

Do you want to dynamically get value of one spefic field by using variable which represents the fieldname?

I'm afraid it's not supported to make this.

You could only use precise fieldname to get value of one spefic field , like this: tablename.fieldname.

Using tablename.variablename will not work.

I suggest you change your table like this:

Language    word

English         Hello 

French          Bonjour

Language and  word is the fields'name.

Then try this:

1)save variable:

Set the screen's OnVisible:    

Set(var1,"English")

2)get value:

Set the label's Text: 

LookUp(tablename,Language=var1,word)

Then, the label will display "Hello".

If you set the var1 to "French", the label will display "Bonjour".

 

 

 

 

Best regards,

 

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

View solution in original post

4 REPLIES 4
shailendra74
Level 10

Re: Get the value of the column value - data source excel.

Hi @RoopaPendyala 

 

Here is how you can do.  Simulated some date

 

ClearCollect(collLang, {Lang: "English", word: "Hello"},{Lang: "French", word: "Bonjour"}) // sample data

when you populate the data from your db/list you will have the fields.

 

 

Set the Text property of a Label to:

LookUp(collLang, Lang=varLANGUAGE,word)  //varLANGUAGE hold one of the languages as per the table you have

Thanks.

RoopaPendyala
Level: Powered On

Re: Get the value of the column value - data source excel.

Hi @shailendra74,

 

Cant we do without creating sample data and hard coding. 

I want to directly pick the value from the datasource.It should be dynamic actually.

If I pass English ( column in excel table) i have to read that columns value in the label.

shailendra74
Level 10

Re: Get the value of the column value - data source excel.

Hi @RoopaPendyala 

 

Yes you can do.  Just because I don't have actual table/columns, I simulated the data.  However, all shared can be done dynamically as you need.

 

ClearCollect(collLang, TableName)

 

Set the Text Property of a Label to: 

LookUp(collLang, LANGUAGEFIELD=varLANGUAGE, VALUEFIELD) // you would need a variable to set the language 

 

Replace LANGUAGEFIELD & VALUEFIELD with respective columns from table (TableName)

Thanks

 

Thanks.

Community Support Team
Community Support Team

Re: Get the value of the column value - data source excel.

Hi @RoopaPendyala ,

Does your table look like this?

(Column Name)    English     French       

(Value)                   Hello      Bonjour

If so, 'English' and 'French' is column name.       

Do you want to dynamically get value of one spefic field by using variable which represents the fieldname?

I'm afraid it's not supported to make this.

You could only use precise fieldname to get value of one spefic field , like this: tablename.fieldname.

Using tablename.variablename will not work.

I suggest you change your table like this:

Language    word

English         Hello 

French          Bonjour

Language and  word is the fields'name.

Then try this:

1)save variable:

Set the screen's OnVisible:    

Set(var1,"English")

2)get value:

Set the label's Text: 

LookUp(tablename,Language=var1,word)

Then, the label will display "Hello".

If you set the var1 to "French", the label will display "Bonjour".

 

 

 

 

Best regards,

 

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

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,857)