Hi Team
I need some help, i have a form now the challenge this form needs to be sent to sharepoint once submitted. The worklow is when clicking Request Action button( must first gets to Responsible Person, second it must be able track the document work flow(who edit the form, where is it sitting and who approve/reject it. Once rejected it must be back to the Responsible person again for second submit approval. All the status must be shown either on sharepoint(column set the column name(ApproverName as Person/Group there will show email outlook).
@Html.LabelFor(model => model.ResponsiblePerson, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
@Html.LabelFor(model => model.ManagerApproval, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
@Html.LabelFor(model => model.SecondManagerApproval, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
@Html.LabelFor(model => model.Status, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
@{
// Create the SelectList
var statusList = (SelectList)ViewBag.Status;
}
@{
// Determine if the status is "Draft"
var isDraft = Model.Status == "Draft";
}
@if (isDraft)
{
// If the status is "Draft", render the dropdown list with the "Draft" option disabled
@Html.DropDownListFor(Model => Model.Status, statusList, "Draft", new { @class = "form-control", disabled = "disabled" })
}
else
{
// If the status is not "Draft", render the dropdown list as usual
@Html.DropDownListFor(Model => Model.Status, statusList, new { @class = "form-control" })
}
SHEQ Non-Conformance Management Record Status (Office Use Only)
@Html.LabelFor(model => model.FileAttachment, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
To submit for immediate feedback, click "Request Action" below.
Guest UserPosted May 11, 2024, 7:09 AM
Hi Mohammed
I dont want that route for this use case, need to develop using asp.net core purely. Maybe i need some logic on the controller side that will handle this from both sharepoint url document library and c#.
Tahir AnsariPosted May 11, 2024, 6:30 AM
To implement the functionality described, you'll need to integrate the form submission with SharePoint and incorporate the workflow logic using Microsoft Power Automate.
1. SharePoint Integration:
- Set up a SharePoint list to store the form submissions. Define columns in the list to capture relevant information such as Responsible Person, Manager Approval, Second Manager Approval, Status, and File Attachments.
- Modify your HTML form to include fields corresponding to the SharePoint list columns. Ensure that the form submission process captures all necessary data.
2. Power Automate Workflo:
- Create a Power Automate flow triggered by the form submission. Use the "When an item is created" trigger to initiate the flow whenever a new item is added to the SharePoint list.
- Configure the flow to send notifications to the Responsible Person, Manager, and Second Manager for approval. You can use the "Start and wait for an approval" action to facilitate this process.
- Implement logic to track the document workflow in SharePoint. Update the status column in the SharePoint list with information about the current approver, approval/rejection decisions, and workflow progress.
- If the form is rejected, route it back to the Responsible Person for resubmission. Update the status column accordingly to reflect the workflow stage.
3. Enhanced Form UI:
- Enhance the UI of your form to provide feedback to users about the status of their submissions. You can display dynamic messages indicating the current workflow stage (e.g., "Awaiting Approval from Manager") and disable form fields during certain workflow stages (e.g., when the form is pending approval).
- Utilize client-side scripting (e.g., JavaScript) to enhance the user experience and provide interactive features such as form validation and real-time status updates.
4. Testing and Validation:
- Test the end-to-end workflow by submitting test forms and verifying that notifications are sent correctly, status updates are reflected in SharePoint, and the workflow progresses as expected.
- Validate the form submission process under various scenarios, including approval, rejection, and resubmission, to ensure that the workflow logic functions correctly in all cases.