cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rados
Helper I
Helper I

Attachment option in Help Desk power app?

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?

4 REPLIES 4
v-bofeng-msft
Community Support
Community Support

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

Title

Single line of text

Description

Single line of text

Category

Single line of text

PercentComplete

Single line of text

Priority

Single line of text

AssignedTO

Single line of text

TaskStatus

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:

HelpDesk App tasklist

Need to add Attachment to a PATCH to a SharePoint List

Best Regards,

Bof

@v-bofeng-msft ,

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
View text

Picture

Yes (read-only)

View image
View text

I think this link will help you a lot :

SharePoint/Known issues

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-sharepoint-onlin...

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:

https://explore.emtecinc.com/blog/how-to-upload-camera-pictures-directly-to-microsoft-sharepoint-wit...

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!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (61,458)