Hi @Rados :
Do you want to add "add attachment" feature to the app.
Do you want to use SharePoint as your data source instead of Office365Users?
Could you tell me whether these fields you mentioned have any special requirements for the data type, or only need the program to run correctly?
This is not difficult to achieve, but to achieve it requires complex operations.
I suggest you read the link at the bottom of my post, this will help you understand my solution.
Here is my solution:
1\Add a list('SP TicketList')
I assume that the data type is configured in the following way.
In addition,ID, Author, Editor, Modified, Created, Created By, Modified By are the default fields of SharePoint list, do not need us to customize
2\Modify the code
I have listed as many detailed steps as possible, but the actual operation is only to replace the data source and adjust some value reference. For specific operations, you can follow the guidance of APP Checker.
MyTicketsScreen(Screen):
MyTicketsScreenGallery-Items:
If(isAdmin,Sort('SP TicketList',ID,Descending),Sort(Filter('SP TicketList',Author.Email = MyProfile.Mail ),ID,Descending))
MyTicketsScreenGalleryId-Text:
ThisItem.ID
ViewTicketScreen(Screen):
1\modify the code
ViewTicketScreenCanvas
ViewTicketScreenDataCard
ViewTicketScreenId-Text:
SelectedTicket.ID
ViewTicketScreenModifiedBy-Text:
Coalesce(First(Office365Users.SearchUser({searchTerm:Text(SelectedTicket.Editor.Email)})).DisplayName, SelectedTicket.Editor.Email)
ViewTicketScreenCreatedBy-Text:
Coalesce(First(Office365Users.SearchUser({searchTerm:Text(SelectedTicket.Author.Email)})).DisplayName, SelectedTicket.Author.Email)
2\Add a Display form(Form1)- Used to display attachments
DataSource:
'SP TicketList'
Item:
SelectedTicket
CreateTicketScreen(Screen):
1\modify the code
CreateTicketScreenCreateButton-Items:
Patch('SP TicketList',Defaults('SP TicketList'),{
Title:CreateTicketScreenTitleText.Text,
Priority: CreateTicketScreenPriorityDropDown.SelectedText.Value,
TaskStatus:"NOT STARTED",
PercentComplete: "0",
AssignedTO:"",
Description:CreateTicketScreenTaskDescription.Text,
Category:CreateTicketScreenCategoryDropDown.SelectedText.Value},Form1_1.Updates);
Reset(CreateTicketScreenTitleText);
Reset(CreateTicketScreenTaskDescription);
Reset(CreateTicketScreenCategoryDropDown);
Reset(CreateTicketScreenPriorityDropDown);ResetForm(Form1_1);
Navigate(ConfirmSubmitScreen,None)
2\Add a New form(Form1_1)- Used to display attachments
DefaultMode:
New
DataSource:
'SP TicketList'
ConfirmationDeleteScreen(Screen):
ConfirmationDeleteScreenDeleteButton-OnSelect:
Remove('SP TicketList',LookUp('SP TicketList',ID =TicketToDelete.ID));
Navigate(MyTicketsScreen,ScreenTransition.None)
EditTicketScreen(Screen):
EditTicketScreenCanvas
EditTicketScreenDataCard
EditTicketScreenHeaderTickerNumber-Text:
SelectedTicket.ID
EditTicketScreenHeaderTickerCreatedBy- Text :
Coalesce(First(Office365Users.SearchUser({searchTerm:Text(SelectedTicket.Author.Email)})).DisplayName, SelectedTicket.Author.Email)
EditTicketScreenHeaderTickerModifiedBy- Text :
Coalesce(First(Office365Users.SearchUser({searchTerm:Text(SelectedTicket.Editor.Email)})).DisplayName, SelectedTicket.Editor.Email)
EditTicketScreenUpdateButton-OnSelect:
If(isAdmin,
Patch(TicketList,LookUp(TicketList,Id=SelectedTicket.ID),{
Priority:EditTicketScreenPriorityDropDown.SelectedText.Value,
Category:EditTicketScreenCategoryDropDown.SelectedText.Value,
TaskStatus:EditTicketScreenStatusDropdown.SelectedText.Value,
PercentComplete:EditTicketScreenCompletedSlider.Value/100,
AssignedTO:AssignedToUserDisplayName,
Editor:MyProfile.Mail,
Modified:Now(),
Description:EditTicketScreenDescriptionInput.Text
}),
Patch(TicketList,LookUp(TicketList,Id = SelectedTicket.ID),{
Priority:EditTicketScreenPriorityDropDown.SelectedText.Value,
Category:EditTicketScreenCategoryDropDown.SelectedText.Value,
Editor:MyProfile.Mail,
Modified:Now(),
Description:EditTicketScreenDescriptionInput.Text
}
));
Reset(EditTicketScreenCompletedSlider);
Reset(EditTicketScreenStatusDropdown);
Navigate(MyTicketsScreen,None)
In addition, I think these links will help you a lot:
HelpDesk App tasklist
Need to add Attachment to a PATCH to a SharePoint List
Best Regards,
Bof