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)
instead of using onChange, build something that concurrently checks if the row has changed - though this should be done in onChange, this is a fool proof way of doing it.
The expression would be like : if(id changes, then run current on change)
I would put the expression in something like a timer or whatever way you want it to constantly check.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional