cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StephaneVedren
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
v-bacao-msft
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
v-bacao-msft
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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,392)