cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

SharePoint List: Item Created Or Modified with condition


Hi, 

I am trying to create a flow between two sharepoint lists.

when an item is created or modified in the first, I get items of the second with discrimination on the "title" which is unique. So normally I'm sure to have just one answer or no answer.

Depending on the presence or absence of an item I want to create a new item or updates the existing one.
To do this I make a condition on "value" "is different from" "null" but apparently even when there is no entry that matches "value" is not empty and it always on "if not"
I'm interested in a good idea ...

Thank you.

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @StephaneVedren,

 

Do you want to create or update items based on Title?

Please make sure that Title is the only value, which is the basis for updating or creating an item.

  • First configure Get items-Filter query, according to Title to check whether there is already the same title item in list 2.
  • Use length() function in Condition to determine if Get items have eligible items.
  • If the result is 0, a new item is created in the list; if the result is not, the item of the same title is updated.

Image reference:

                   12.PNG

@equals(length(body('Get_items')?['value']), 0)

13.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support
Community Support

Hi @StephaneVedren,

 

Do you want to create or update items based on Title?

Please make sure that Title is the only value, which is the basis for updating or creating an item.

  • First configure Get items-Filter query, according to Title to check whether there is already the same title item in list 2.
  • Use length() function in Condition to determine if Get items have eligible items.
  • If the result is 0, a new item is created in the list; if the result is not, the item of the same title is updated.

Image reference:

                   12.PNG

@equals(length(body('Get_items')?['value']), 0)

13.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

thank you very much it works fine.
I was missing the function "length".
Flow's function formulas are not very simple for non-computer scientists ...

Are there any books to help us?
In any case I thank you for your responsiveness.

 

Stephane

Hi @StephaneVedren ,

 

Please check this link and see if it helps:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,745)