cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Community Support
Community Support

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
Highlighted
Anonymous
Not applicable

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.

Highlighted
Helper I
Helper I

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.

Anonymous
Not applicable

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.

Highlighted
Community Support
Community Support

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

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.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,388)