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

Power Automate Desktop执行JS触发blur事件未触发QuickBooks表单代码的原因?

问题描述

我正在使用Power Automate Desktop的Execute Javascript流程,尝试自动化Quickbooks Online Payroll表单的部分用户输入操作。原生操作该表单时,blur事件会触发数值输入验证等相关逻辑,但通过JS流程更新输入框值后,保存表单时这些输入框会显示为空,表单并未识别到更新的值。因此我认为需要触发blur事件来让数据被表单识别并保存,以下是我的JS脚本:

function ExecuteScript() { 
   var $payrollTableRows = $("table").first().find("tbody > tr.enabled");
   var $regHoursInput;
   var decRegHours;
   var $bonusInput;
   var employeeName;
   
   console.log('Power Automate: Rows Found: ' + $payrollTableRows.length);
   
   $payrollTableRows.each(function(){
   
        employeeName = $(this).find("td:eq(1)").find("a").text();
        
            $regHoursInput = $(this).find("input[wageitemid='HOURLY_PAY']");
            if($regHoursInput){
                    decRegHours = Number($regHoursInput .val());
                    
                    $bonusInput = $(this).find("input[wageitemid='BONUS']");
                    $bonusInput.focus();
    
                    if($bonusInput){
                        $bonusInput.val(decRegHours);
                        $bonusInput.trigger('blur');
                    } 
                } 
    });
}

QB Payroll页面上focus和blur事件触发时执行的脚本截图:
QB Payroll焦点/失焦事件执行脚本

请问为何我脚本中触发的blur事件没有执行这段代码?

更新1

添加页面截图:
Payroll页面截图

更新2

附上我使用的PAD流程,相关操作参考了某视频,循环及循环索引的使用参考了某文章。我的流程截图:
Power Automate Desktop更新HTML表格流程截图

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.09 23:20:39