Hello. I have conditions in an expression for a person field but I want to make the false result as blank.
I've tried the following but still getting the same error (user not found)
If(Or(equals(triggerBody()?['Step_Name'], 'ABC Review')),triggerBody()?['Person1']?['Claims'],If(Or(equals(triggerBody()?['Step_Name'], 'DEF Review')), triggerBody()?['Person2']?['Claims'],''))
If(Or(equals(triggerBody()?['Step_Name'], 'ABC Review')),triggerBody()?['Person1']?['Claims'],If(Or(equals(triggerBody()?['Step_Name'], 'DEF Review')), triggerBody()?['Person2']?['Claims'],null))
If(Or(equals(triggerBody()?['Step_Name'], 'ABC Review')),triggerBody()?['Person1']?['Claims'],If(Or(equals(triggerBody()?['Step_Name'], 'DEF Review')), triggerBody()?['Person2']?['Claims'],-1))
Any suggestions? thank you ahead
Solved! Go to Solution.
You can solve the issue by using Send http request to SharePoint to update your item. Please note that using Update Item action will not work in case of Multiple value people field, therefore it is best to use the Send http request to SharePoint when you want to clear the value of a people field.
The method used in the below article will work
In short:
You need to get the id of the user as stated in the article and then update you expression accordingly.
Let me know if you require any details. but it will solve you a lot of trouble to use this method
Hi @lui,
It seems like have some logic error in your expression, the structure of or() function is or(expression1, expression2, ...)
You can try to test the following expression firstly:
if(equals(triggerBody()?['Step_Name'], 'DEF Review'), triggerBody()?['Person2']?['Claims'],null)
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft Well right now, i have the following expression and it works fine:
If(Or(equals(triggerBody()?['Step_Name'], 'ABC Review')),triggerBody()?['Person1']?['Claims'],If(Or(equals(triggerBody()?['Step_Name'], 'DEF Review')), triggerBody()?['Person2']?['Claims'],triggerBody()?['Person2']?['Claims']))
I want to replace the false result (in bold) to a blank value. If I replace the bold section with null it doesnt work. What do you suggest?
Hi @lui,
Please have a try the following expression:
If(Or(equals(triggerBody()?['Step_Name'], 'ABC Review')),triggerBody()?['Person1']?['Claims'],If(Or(equals(triggerBody()?['Step_Name'], 'DEF Review')), triggerBody()?['Person2']?['Claims'],if(equals(triggerBody()?['Person2']?['Claims'],null),false)))
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-litu-msft entering "false" did not work. This is the error I keep receiving when i tried null, false, -1
Hi @lui,
How about using a Blank character: " "?
Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've tried , '') but it doesnt work. Im running out of options! There must be a way to have a blank result when using conditions.
You can solve the issue by using Send http request to SharePoint to update your item. Please note that using Update Item action will not work in case of Multiple value people field, therefore it is best to use the Send http request to SharePoint when you want to clear the value of a people field.
The method used in the below article will work
In short:
You need to get the id of the user as stated in the article and then update you expression accordingly.
Let me know if you require any details. but it will solve you a lot of trouble to use this method
Looks like I'm a year late replying to this. In Short the right answer is to use "Send http request to SharePoint " the problem with that answer is that it's not sexy compared to using the "Create Item" and "Update Item" actions.
I did come to a solution that can help some.
In scenarios where the Claims were empty, I would add a conditional Update Item right after creating the item.
If the Claim wasn't empty I would trigger the update. If it was empty I wouldn't trigger the update.
This is a solution until Microsoft improves the "Create Item" and "Update Item" actions
User | Count |
---|---|
89 | |
40 | |
22 | |
20 | |
16 |
User | Count |
---|---|
136 | |
55 | |
47 | |
36 | |
25 |