You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用DatePicker控件从SharePoint List获取数据填充富文本框

解决方案

核心问题

你现有代码存在2个逻辑错误:

  • Filter函数作用是返回符合条件的数据表集合,无法在筛选参数内完成控件赋值操作
  • 你将富文本框与SP列的匹配逻辑写在了筛选条件中,位置完全错误

正确实现步骤

1. 编写日期选择器OnChange事件代码

如果单条日期仅对应单条交接班记录,优先用LookUp直接取匹配的单条记录值,写入变量:

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

如果出现时区偏差导致日期匹配失败的情况,改用按年月日逐位匹配:

Set(varShiftSummary, LookUp(current_shift, 
    Year(shift_date) = Year(DatePicker1.SelectedDate) && 
    Month(shift_date) = Month(DatePicker1.SelectedDate) && 
    Day(shift_date) = Day(DatePicker1.SelectedDate)
).shift_summary)

2. 绑定富文本框属性

将富文本框richShiftSum_2的Default属性设置为:
varShiftSummary

多控件适配(对应2个日期选择器+2个富文本框)

第二个日期选择器DatePicker2的OnChange事件设置对应变量:

Set(varShiftSummary2, LookUp(current_shift, shift_date = DatePicker2.SelectedDate).shift_summary)

第二个富文本框的Default属性绑定varShiftSummary2即可。

内容的提问来源于stack exchange,提问作者gherkin12

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.02 07:09:00