英文:
Checking if CELL in excel is blank before populating with Form answer
问题
I am trying to write an expression that will check if a cell in a row in excel is blank, and if it is then insert an answer from a microsoft form, but if it isn't blank then just leave it as is.
我正在尝试编写一个表达式,以检查Excel行中的单元格是否为空,如果为空,则插入来自Microsoft表单的答案,但如果不为空,则保持不变。
英文:
I am trying to write an expression that will check if a cell in a row in excel is blank, and if it is then insert an answer from a microsoft form, but if it isn't blank then just leave it as is.
For a bit of background info, The flow I am writing does the following:
Takes a response from a microsoft form - which users fill out when they are changing job role - and then fills in the appropriate cells according to whats required for that job.
I have over 90 columns in my table and each job role (10 approx.) requires a different combination of each, so it was very time consuming to go in and insert the form response into each required column - see below.
So I am trying to write an expression that will check the contents of the cell to prevent overwriting already existing information.
I tried something like the following:
if(outputs('Get_a_row')?['body/HR PO 004'] = "","R"outputs('Get_response_details')?['body/r4cbf6e58f25742ff8104f08b6afe1b5e'],)
but it didn't work.
答案1
得分: 1
It’s all expression based in PowerAutomate, much like Excel, try this instead (untested) ...
如果你的情况类似于PowerAutomate和Excel,尝试使用以下代码(未经测试)...
if(equals(body('Get_a_row')['HR PO 004'], ''), body('Get_response_details')['r4cbf6e58f25742ff8104f08b6afe1b5e'], body('Get_a_row')['HR PO 004'])
... also, you've noticed I've changed out outputs
for body
.
...还要注意,我已将outputs
更改为body
。
If it doesn't work 100%, you'll at least understand that you need to use the equals
function to perform the comparison, not an operator like =
.
如果不完全有效,至少你会明白需要使用equals
函数进行比较,而不是像=
这样的运算符。
英文:
It’s all expression based in PowerAutomate, much like Excel, try this instead (untested) ...
if(equals(body('Get_a_row')?['HR PO 004'], ''), body('Get_response_details')?['r4cbf6e58f25742ff8104f08b6afe1b5e'], body('Get_a_row')?['HR PO 004'])
... also, you've noticed I've changed out outputs
for body
.
If it doesn't work 100%, you'll at least understand that you need to use the equals
function to perform the comparison, not an operator like =
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论