Hi all,
We are trying to make an Help Desk app where users will be able to create ticket with an attached image. After attachment is uploaded to Help Desk application, and submitting a ticket, that image should be stored on a OneDrive or SharePoint list for example? I want to add an attachment option/button just below "Description" section.
Does anybody have experience with this?
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.
Column (click to edit) | Type |
Single line of text | |
Single line of text | |
Single line of text | |
Single line of text | |
Single line of text | |
Single line of text | |
Single line of text |
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:
Need to add Attachment to a PATCH to a SharePoint List
Best Regards,
Bof
Yes, I want to add multiple attachments feature to the app (if possible). A SharePoint list is set as data source file. I've used this link as a reference: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/help-desk-install
This solution works just fine, but we need to make some changes. Is it possible to make a column "photo" in SharePoint data source file, which will collect attached photos in Help Desk app? Eventualy, we wanto to be able to put other files also (word, excel, pdf..).
Hi @Rados :
Do you want to patch the SharePoint list with the images?
Firstly ,I want to explain why you can not patch the image to the SharePoint list.
Since the data source is SharePoint, It is not feasible to update the Picture field with an image file in canvas app.
In addition, you can update Hyperlink field with URI.
Column type | Support | Default cards |
Hyperlink | Yes | View URL |
Picture | Yes (read-only) | View image |
I think this link will help you a lot :
SharePoint/Known issues
Secondly,If you insist on doing this, there are ways. But this solution requires flow, which will make your development work more difficult.
I think this link will help you a lot:
PowerApps: Upload Images to SharePoint
https://piyushksingh.com/2019/09/25/powerapps-upload-images-to-sharepoint/
How to Upload Camera Pictures directly to Microsoft SharePoint with PowerApps and Microsoft Flow:
Best Regards,
Bof
Hi @v-bofeng-msft,
Just to notice you that I didn't find solution for our Help Desk App. I've been busy these days, because I'm finishing another Power App, so sorry for my late answer. I found potential solution, for Help Desk App, on this link: https://repointtechnologies.com/saving-images-from-powerapps-to-sharepoint/, but I didn't read it yet. Soon as I finish app I'm currently working on, I will send a post.
Thanks for your feedback!
User | Count |
---|---|
256 | |
254 | |
82 | |
41 | |
30 |
User | Count |
---|---|
319 | |
269 | |
121 | |
68 | |
50 |