I have a gallery with survey topics, and a rich text input box outside the gallery.
The default property of the rich text input is a lookup into collection 'ResponseCollect'.
OnChange has a patch function in an attempt to get the user's input written into the collection when they click onto the next item in the gallery.
The text is written only if the user clicks elsewhere on the page before selecting the next gallery item. If a gallery item is selected the text input is lost.
How can i ensure the OnChange function is triggered when a new gallery option is selected? OnSelect of the Gallery is currently blank
Default:
LookUp(ResponseCollect, Topic = Gallery.Selected.TopicInput.Text, Commentary)
//ResponseCollect is the collection of all responses, this is later patched to SQL
//Gallery holds the topics of the survey for which the user needs to provide commentary
OnChange:
Set(NewResponse, Defaults(ResponseCollect));
//NewResponse collection is used to patch a single row to ResponseCollect
Set(NewResponse,
Patch(NewResponse,
{Topic: Gallery.Selected.TopicInput.Text,
Commentary: Narrative.HtmlText,
Customer: Customer.Text,
ProjectName: ProjN.Selected.Value,
ProjectID: ThisProjectID.Text,
SurveyConductedBy: Conducted_By.Text,
SurveyDate: Survey_Date.SelectedDate,
PersonSurveyed: Person_Surveyed.Text}));
Patch(ResponseCollect,
Coalesce(LookUp(ResponseCollect, Topic = Gallery.Selected.TopicInput.Text)),
Defaults(ResponseCollect),
NewResponse)