cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted

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

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,132)