0

good afternoon, I was wondering if someone might be able to assist me with the issue that I'm having.

I have created a SP List called current_shift which logs our shift handovers - using the Patch command to create an item works fine. When I want to retrieve this information I'm struggling.

I have two Rich Text boxes and two date picker controls on a screen (I'm not using a form or gallery) and basically want the Rich Text Boxes to display the shift_summary column applicable to those date(s). So for example if the user selects 01/09/2021 in the date picker, the list is queried and will display the shift_summary for that date in the Rich Text Box.

The code I have currently on the OnChange function of the DatePicker (which doesn't work :( ):

Filter(current_shift, shift_date = DatePicker1.SelectedDate, richShiftSum_2=shift_summary)

Any ideas greatly appreciated.

TIA

gherkin12
  • 9
  • 1
  • 3

1 Answers1

0

If you want to display the current shift's summary, you can use this expression in the HtmlText property of an HTML Text control:

LookUp(current_shift, shift_date = DatePicker1.SelectedDate, shift_summary)

Or if you want to let the user edit that, you can use the same expression in the Default property of a Rich Text Editor control.

Power Apps uses a declarative language; when the selected date changes in the date picker, it will automatically "recalculate" all the expressions that depend on it, similarly to what Excel does when the value of a cell is changed.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171