cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

Update existing or create a new SharePoint item via Form entry

Good Morning all.

 

I have a Form that includes the following information.  Date, Office, Loaction, Manager, Model, Serial and Asset

 

The Form needs to update a SharePoint list.  If the Asset is not currenty recorded a new item should be added to the list.  If the asset is there already then that item should be updated.  The Date, Office, Location and Manager are able to change while the Asset, Model and Serial number would always stay the same.

 

I have tried to build a Flow that will collect the form data, reference the SharePoint site and either update the existing record based on Asset or add a new entry.  

 

Can anyone help me with a reccomendation on a flow to use?  I would think something like this would be rather common but can not find any examples...

 

Thank you,

Adam

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Update existing or create a new SharePoint item via Form entry

Hi @AdamWeinstein ,

 

Do you want to create a new item in SharePoint list if it doesn’t exist, otherwise, update the existing item?

 

I have created the following flow for your reference. In my scenario, name from Forms has common value with Title from the list, and would always stay the same.

 

  • Add the trigger When a response is submitted.
  • Initialize an Array variable named as Test.
  • Add action Get response details, an Apply to each will be added automatically.
  • Get items from the list.
  • Add an Apply to each 2, select value from Get items, then add action Append to array within the apply to each 2, select Title for the Value field.
  • Under Apply to each 2, add a Condition to check if the variable Test contains name from the trigger.
  • If yes, add Condition 2 to check if Title is equal to Name, then add action Update item under If yes branch of Condition 2.
  • If no, create an item in the list with corresponding value from the form.

 

2.PNG3.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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

Re: Update existing or create a new SharePoint item via Form entry

Hi @AdamWeinstein ,

 

Do you want to create a new item in SharePoint list if it doesn’t exist, otherwise, update the existing item?

 

I have created the following flow for your reference. In my scenario, name from Forms has common value with Title from the list, and would always stay the same.

 

  • Add the trigger When a response is submitted.
  • Initialize an Array variable named as Test.
  • Add action Get response details, an Apply to each will be added automatically.
  • Get items from the list.
  • Add an Apply to each 2, select value from Get items, then add action Append to array within the apply to each 2, select Title for the Value field.
  • Under Apply to each 2, add a Condition to check if the variable Test contains name from the trigger.
  • If yes, add Condition 2 to check if Title is equal to Name, then add action Update item under If yes branch of Condition 2.
  • If no, create an item in the list with corresponding value from the form.

 

2.PNG3.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
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
Regular Visitor

Re: Update existing or create a new SharePoint item via Form entry

Hello,

 

With a few minor tweaks we got it to work as needed.  This might be a useful template for people that want to use a form to create or update an item on a list. 

 

Thank you again,

Adam

Highlighted
Helper III
Helper III

Re: Update existing or create a new SharePoint item via Form entry

Hi Adam,

 

Did you use a SharePoint list as a source for this? If yes, can you please share the logic or screenshots of the workflow? I am trying to achieve the same and have some issues.

 

Thanks,

 

Santosh

Helpful resources

Announcements
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.

Upcoming Events

Experience what’s next for Power Automate

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

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (6,571)