This is my first app and first post... so please be gentle.
I have created two Sharepoint lists Project list and Materials list.
The MIR Project allows a User to input several values Deliver to, Business Unit, Name of vessel and the date the materials are required
This I can create from PowerApps and the details are updated in Sharepoint.
What I am stuggling with is the ability for the user to update materials and "link" these to the correct MIR Project (I have added a lookup MIR Project AOGOG spares, Project UMbongo, Jenny spares etc.
I have created a gallery view with apart from the formatting looks ok.
But I need to be able to create new materials and add them to the list.
The values are SAP ID, Description, UOM and Required Quantity.
Hi @craigfer
Your requirement does not look complex, and I believe you are unnecessarily making it complex. Both SubmitForm and Patch functions serve similar purposes, but they have distinct use cases.
I suggest you use a form and can disable the combo box so that users don't add the materials to wrong project.
The differences between the SubmitForm and Patch functions in Power Apps:
SubmitForm:
Use SubmitForm when you want to update the contents of an edit form in a straightforward way.
It’s commonly used for simple scenarios where you have an edit form bound to a data source (e.g., SharePoint list or SQL database).
When the user submits the form, SubmitForm automatically handles creating or updating the record based on the form inputs.
Patch:
Use Patch when you need more control or have more complex requirements for creating or updating records.
It allows you to modify records in more intricate situations, such as:
Updates that require no user interaction.
Forms that span multiple screens.
Custom logic for handling specific scenarios.
With Patch, you explicitly define which fields to update and how to update them.
When to Choose Each Function:
SubmitForm:
Use it for simple forms where the built-in behavior of form submission meets your needs.
It’s ideal for scenarios where you want the form to handle most aspects of record creation or update.
Patch:
Choose it when you need more flexibility and control.
Use it for scenarios like multi-screen forms, custom validation, or specific data transformations.
You can combine multiple Patch statements to update different parts of a record or handle complex business rules.
In summary, if your requirements are straightforward and align with the default behavior of form submission, SubmitForm is a good choice. However, if you need more customization or have complex scenarios, opt for Patch. It provides greater flexibility and transparency in how records are updated.
Sunil thanks for your response. I was trying to use the PATCH function as most information says this is better than a forms solution. I dont know.
On the Materials selection screen and using this formula in the header
This means the user sees the correct project to add the materials. I would like to use this in the formula instead of a dropdown so the user doesnt add the materials to the wrong project.
Hi @craigfer,
If I am not wrong, you are looking for a screen which helps you to create details (materials) for MIR Projects.
If yes, then please go through below, else let me know clearly again what you are looking for, thanks.
To allow users to create new materials, you can add an input form where they can enter the material details.
Set the datasource to Materials SharePoint list, and set item to Materials gallery selected item.
Here’s how you can set it up:
When the user clicks on “Add Material” button, NewForm(FormName) - Set the form mode to new.
On the new screen, add input fields for SAP ID, Description, UOM, and Required Quantity, MIR Project.
Include a “Save” button that, when clicked, creates a new item in the “Materials” list with the entered details.
After saving, you will see the new item in the gallery.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Sunil Pashikanti - Tech Blog: PowerApps
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional