Forum Discussion
Forms to Sharepoint with Column conditions
timparsons the way I do this sort of thing is as follows and doesn't involve arrays. I have 2 lists, the main one for the orders and a second one that holds the unit cost for each item that might be ordered:
Following is the form:
The flow is then below. The trigger is When a new response is submitted and the first action is Get response details.
Next, add a SharePoint Get items gets the items from the UnitCost list:
Next add an Apply to each control and select value from the Get items section of the dynamic content. Next, add a Condition and in the left box select Title from the Get items section of the dynamic content is equal to then select Item from the Get response details section of the dynamic content.
Even though you would have asked for the quantity in your form, Forms nevertheless saves it as text. So add a Compose and add the following expression (in the Expression tab of the dynamic content box):
As you can see, the number ordered, their unit cost and the total cost are added into the SharePoint list:
Hope that helps.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- timparsonsJun 08, 2020Brass ContributorThanks for that Rob. I'll have to try that out. How would they go about selecting more than one item - for example 2 headsets and 2 monitors? Would the user need to go through the form for each item?
- RobElliottJun 08, 2020Silver Contributor
timparsons yes the way I've done it they would need 1 form for however many laptops they wanted and a separate form for however many headsets etc. I'll post up the method for combining item types as soon as possible.
Rob
Los Gallardos
Microsoft Power Automate Community Super User