need help designing a flow please

Copper Contributor

the project :

I have a Forms.
I have a list in share point.

I want to create a line in the list via my form (I succeeded)

I would like to add a condition: if the name of the company of the form is already present in my list, do not create but update (it creates a new one for me each time)

if the name of the company is not in the form, create a new one (that's ok as it is)
but I want to add an approval, it works but I don't understand because I sometimes receive 2, 3, 4 requests... (and therefore it creates 2, 3, 4 lines)

 

moreover I would like who does not touch the field if it is empty, but if it is filled, that he updates it. I tried with the IF formula but I did not succeed so I tested differently.

here is what i tried to do, thanks for your advice

 

01.png

 

in this version I removed the approval to save you time in the tests

02.png

 

here is what i tried to do for null fields

 

03.png

 

the flows are systematically basulet on "no" during the analysis
I don't understand why there are 4 phases

 

04.png

 

Thanks

 

1 Reply

Hi @laurent5, to test a solution I have created a Form, a SharePoint list and Flow to do what you need to (I hope this addresses your problem)...

 

The form has three basic fields, with Company name being the only required field.

jonlake_0-1680622528229.png

The SharePoint list has corresponding fields.

jonlake_1-1680622566535.png

The Flow is triggered by a Form submission and immediately tries to retrieve items from the SharePoint list where the company name matches the Form submission.

jonlake_2-1680622682387.png

A condition then evaluates the items returned from the list, using a 'length' expression (

length(outputs('Get_items')?['body/value'])) to determine whether any items were returned (meaning a match was found). If the 'length' is greater than 0 (there was a match), the corresponding item is updated. If the 'length' is 0 an approval workflow is started.
jonlake_3-1680623638192.png

 

jonlake_0-1680677292504.png

 

If the approval response is 'Approve' the a new item is created.

jonlake_5-1680625883838.png

 

Null values from the form are handled using an expression, which requires you to use the filed ID from the Form itself. An example would be:

jonlake_6-1680626022520.png

If the company already exists then the update path is followed.