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

Getting Value of Field in Edit Forms invisible

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)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Getting Value of Field in Edit Forms invisible

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,

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

3 REPLIES 3
iiBzY
Level: Powered On

Re: Getting Value of Field in Edit Forms invisible

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?

Mark2457
Level: Powered On

Re: Getting Value of Field in Edit Forms invisible

thqanks for reply. I'm not sure how I'd do that.

 

attached are a few screen shots of my form

 

datacard.png

 

 

dropdown.png

Community Support Team
Community Support Team

Re: Getting Value of Field in Edit Forms invisible

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,

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 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 Kudoed Authors (Last 30 Days)
Users online (3,795)