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

Context Variables not working in Forms

Hi,

 

Within my form I have a gallery that you can search on, and if you select a record within that gallery, that record gets saved to a context variable to populate other fields within the form. The problem is that it is not recognizing that context variable within  the form and so it is not able to populate the fields. To populate the field, I am calling the context variable within the field's textinput default property.

 

I do know that the context variable is working because I tested it by printing it outside of the form. Are there any ideas why the form is acting this way?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @kianlutu,

 

Would it be convenient for you to share a screenshot?

Further, could you please explain a bit for this sentence "that record gets saved to a context variable to populate other fields within the form."?

If the Variable is used to store a record, then the formula that we should use to reference the corresponding data should be:

first(VariableName).FieldName

That is because the variable is considered as a single row table.

 

Regards,

Michael

Community Support Team _ Michael Shao
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

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @kianlutu,

 

Would it be convenient for you to share a screenshot?

Further, could you please explain a bit for this sentence "that record gets saved to a context variable to populate other fields within the form."?

If the Variable is used to store a record, then the formula that we should use to reference the corresponding data should be:

first(VariableName).FieldName

That is because the variable is considered as a single row table.

 

Regards,

Michael

Community Support Team _ Michael Shao
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

Highlighted

 

Hi Michael,

 

Attached are two images. The top shows the app running in the browser with the selected item. At the top of the PowerApp I placed a text input to check if it gets saved to the context variable, which it does, but it does not reflect with in the form control. The red TextInput controls are the fields it should be populating.

 

In the bottom image, it shows the same selected item but it is able to pull in the item within the form controls. Also, at the top, shows the formula used to call it.

 

Any Ideas?

 

Thanks,

 

Kian

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,936)