
Announcements
Hi All,
Currently, I have a flow "When a new email arrives (V3)" wherein it gets all the information of the email body which are:
* Incident Number
* Status
* Received Date/Time
Then, it should update/create item based on the "get items condition", please see below flow:
If yes "Update Item"
- I used this for the duplicate entries so that only the status will update once a duplicate incident came.
(eg. INC12345 arrives yesterday with Active Status then also arrives today with resolved status.)
- I also don't recommend to delete the items since we're inserting additional information on that item via "PowerApps".
Now, the problem is on the If no "Create Item" which i have alot of confusion
- On the get items i used a filter query "title eq "M365_Incident" so that it will only get the same item on the list and update it. I tried to remove but it caused issue wherein it update the current item and create alot of duplicate items based on the values that are not same with the M365_Incident.
- But when i retain the filter query "title eq "M365_Incident" and a new incident arrives that are not on the sp list i get the value below:
Then the flow will stop.
What the output should be is to follow the If no "create item" condition.
Hoping that i explained everything.
Anyone that can help me with this? Thank you very much.
Hi @heydamianards,
There is some default on the Flow structure. In your original Flow, the output of the Get items already filter by the Title eq "M365_Incident", so titles of these items are all equal to the arrived value of M365_Incident. There is no need to create additional Condition action into the Apply to each action.
Then you should use length() function to determine the length of values from Get items, if it not equals to 0, it means there already has item exist in the list, then update item; if it equals to 0, it means there is no item in list, so you should create a item:
length(body('Get_items')?['value'])
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.