cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fusion
Frequent Visitor

Getting information form a DataTable to Text Box's

Hey all, need some help. I have been trying to get information form a Data Table and populate a bunch of textboxes when the user presses the Edit button. 

I have used the txtBrand.Text = dtDeviceInfo.Selected.Brand but nothing shows up and I have been researching through this site and can't seem to find a way to do this. 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Getting information form a DataTable to Text Box's

@Fusion 

 

For a Text Input control, you need to place this expression on the "Default" property.
 
Hope this Helps!

View solution in original post

6 REPLIES 6
Dual Super User
Dual Super User

Re: Getting information form a DataTable to Text Box's

Hi @Fusion 

 

Can you please confirm where you are putting this value for the DataTable selected item? I carried out a simple test on my side and it worked fine.
 
I have made a reference to Data Table selected item on the label, but using below mentioned formula on Text property of label:
Expression: 
DataTable1.Selected.Education
Here DataTable1 refers to the name of my DataTable and the Education is the attribute that I want to refer to.\MicrosoftTeams-image (141).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Fusion
Frequent Visitor

Re: Getting information form a DataTable to Text Box's

Sorry for taking a while to reply the issue is I need it done when the user hits the edit button. 

So within btnEdit.OnSelect I have the code 

txtBrand.Text = dtDeviceInfo.Selected.Brand

Which then does nothing when the button is pressed

Dual Super User
Dual Super User

Re: Getting information form a DataTable to Text Box's

@Fusion 

 

This is happening because you cannot set control text directly, for doing so, please follow below steps:
 
Button -> OnSelect -> Set(SelectedBrand, dtDeviceInfo.Selected.Brand)
 
Label -> Text -> SelectedBrand
 
Using a variable you can directly set the reference to update value.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Fusion
Frequent Visitor

Re: Getting information form a DataTable to Text Box's

I just tried your response but the issue is that I am using a text box and not a lable as this is also used as an input method. 

The text box does not have the TEXT property in the pull downAnnotation 2019-07-02 160831.png

Dual Super User
Dual Super User

Re: Getting information form a DataTable to Text Box's

@Fusion 

 

For a Text Input control, you need to place this expression on the "Default" property.
 
Hope this Helps!

View solution in original post

Highlighted
Fusion
Frequent Visitor

Re: Getting information form a DataTable to Text Box's

So easy how did I not know that

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

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!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (7,441)