Forum Discussion
laurent5
Mar 30, 2023Copper Contributor
need help designing a flow please
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 i...
jonlake
Apr 04, 2023Iron Contributor
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.
The SharePoint list has corresponding fields.
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.
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.
If the approval response is 'Approve' the a new item is created.
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:
If the company already exists then the update path is followed.