Hi Team,
I have a simple form with three text fields and a DropDown control. The issue that I face is as below.
1) The Datasource of the whole form is from a single table named Milestone.
2) The data source for the dropdown is a field (Project_Id) that is type Lookup and mapped to another table named Project (Foreign Key).
Below is the table Milestone where Project_Id is a Lookup field
Below is the Project table having Projectid as Unique field.
To give more context, below are the details of the Project table with important fields been highlighted
3) When I run the screen, I can see actual values of the Project names in the dropdown. Till now everything works fine.
4) What I wanted is, when I select any value from the dropdown, I want the selected text to be copied to a TextBox which I made visible false so as to capture the selected values from the DropDown. My only reason to have an extra textbox is to capture the value of the dropdown. If you guys can suggest a better option then nothing like that.
What steps I did:
1) In the OnChange event of the DropDown, I wrote below UpdateContext code, which is not working
UpdateContext({selectedTrade:Lookup([@Projects], Community=drpProjects.Selected.Value, Name))
Solved! Go to Solution.
Hi @mehardikdave ,
Could you tell me:
What’s the data type of Community column? Is it a text column?
Do you want to display the contents of the Milestone table in the dropdown control and the name of the Project table in the label control?
I assume:
You want to display the value of the name column of the Milestone table in the dropdown control.
You want to display the value of the Name column of the Project table in the label control.
I did a test for you
1\ This is my test Milestone table and Project table.
2\ Add a dropdown control and set its Items property to:
Milestones
Set the onchange property of the dropdown control to:
UpdateContext({selectedTrade: LookUp(Milestones,Milestone=Dropdown1.Selected.Milestone).Project_Id.Name})
// Dropdown1 is the name of my dropdown control.
// Milestone is Unique Identifier.
3\ Add a label control land set its Text property to:
selectedTrade
4\ The result is as follows:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi @mehardikdave ,
Could you tell me:
What’s the data type of Community column? Is it a text column?
Do you want to display the contents of the Milestone table in the dropdown control and the name of the Project table in the label control?
I assume:
You want to display the value of the name column of the Milestone table in the dropdown control.
You want to display the value of the Name column of the Project table in the label control.
I did a test for you
1\ This is my test Milestone table and Project table.
2\ Add a dropdown control and set its Items property to:
Milestones
Set the onchange property of the dropdown control to:
UpdateContext({selectedTrade: LookUp(Milestones,Milestone=Dropdown1.Selected.Milestone).Project_Id.Name})
// Dropdown1 is the name of my dropdown control.
// Milestone is Unique Identifier.
3\ Add a label control land set its Text property to:
selectedTrade
4\ The result is as follows:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
That worked. Thanks
User | Count |
---|---|
162 | |
85 | |
68 | |
63 | |
61 |
User | Count |
---|---|
212 | |
146 | |
93 | |
81 | |
67 |