Hi All
I have column in my data source, which is bound to a dropdown
I need to bind the dropdown to variable (varGrade), as there are several buttons that can change the grade (not just user choosing from List. The dfault value for this is ThisItem.Grade, I'm changing this to varGrade
I understand the best way to accomplish this is in the OnVisble event of the form. (I need to do this fro several items)
Even if I use a literal string, the label bound to varGrade shows nothing
UpdateContext({varGrade: "Grade 4",});
So my plan is to get the value of Grade and save in VarGrade, Then my buttons will update varGrade. Problem is I don't know how to get varGrade
Tried a few things
UpdateContext: ({varGrade: ThisItem.Grade}); this says invalid use of "."
or
UpdateContext: ({varGrade: ([@tblCrops].Grade)}); this causes the controls bound to varGrade to give and error (expects Text)
Solved! Go to Solution.
Hi @Mark2457 ,
Could you tell me the data type of Grade column?
I've made a similar test for your reference:
1)if it is a choice column.
Set the drop down's Items:
Choices(listname.Grade)
Set the Grade datcard's Default:
{Value:vargrade}
Set the screen's OnVisible:
UpdateContext({varGrade: "Grade 4",}) //you could not test it untill you are running the app, in edit mode the action will not perfrom
2)if it is a text column.
Set the drop down's Items:
Distinct(listname,Grade)
Set the drop down's Default: (this datacard has been customized, so it is useless to set the datacard's default)
vargrade
Set the screen's OnVisible:
UpdateContext({varGrade: "Grade 4",}) //you could not test it untill you are running the app, in edit mode the action will not perfrom
Best regards,
From my understanding of your question, why don't you bind the DataCardValue.SelectedItems to the context variable? Or this that not what you're trying to achieve?
thqanks for reply. I'm not sure how I'd do that.
attached are a few screen shots of my form
Hi @Mark2457 ,
Could you tell me the data type of Grade column?
I've made a similar test for your reference:
1)if it is a choice column.
Set the drop down's Items:
Choices(listname.Grade)
Set the Grade datcard's Default:
{Value:vargrade}
Set the screen's OnVisible:
UpdateContext({varGrade: "Grade 4",}) //you could not test it untill you are running the app, in edit mode the action will not perfrom
2)if it is a text column.
Set the drop down's Items:
Distinct(listname,Grade)
Set the drop down's Default: (this datacard has been customized, so it is useless to set the datacard's default)
vargrade
Set the screen's OnVisible:
UpdateContext({varGrade: "Grade 4",}) //you could not test it untill you are running the app, in edit mode the action will not perfrom
Best regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
185 | |
53 | |
41 | |
37 | |
31 |
User | Count |
---|---|
246 | |
75 | |
71 | |
69 | |
65 |