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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (31,518)