cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JerryH
Helper V
Helper V

Customised Help Desk template code support

Hi

I downloaded the help desk template and have customised it.

 

Below is 1. the Default OnStart code - (does not permanently store tickets & it has default tickets)

Below is 2. My Code when i click on Create Ticket

 

Objective:

To permanently store tickets, please help me resolve the OnStart & Create Ticket code.

 

 

1. OnStart Code

ClearCollect(TaskCategories,["CALL OUT REQUIRED","SPARE PART REQUIRED","TELEPHONIC ADVICE"]);
ClearCollect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED");
ClearCollect(TaskPriority,"HIGH","MEDIUM","LOW");
Set(MyProfile,Office365Users.MyProfile());
ClearCollect(AdminList,"jerry.haldane@atalianworld.com");
ClearCollect(TicketList,{Id:1,Title:"Fix Mouse",Description:"That is my cat!!!",Category:"CALL OUT REQUIRED",PercentComplete:"0.9",Priority:"HIGH",AssignedTO:"THOMAS ANDERSEN",TaskStatus:"COMPLETED",Author:"ScottK@contoso.com",Editor:"Scott Konersmann",Created:"2/8/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"},{Id:2,Title:"Replace keyboard", Description:"Please do it ASAP",Category:"SPARE PART REQUIRED",PercentComplete:"0.8",Priority:"LOW",AssignedTO:"YVONNE MCKAY",LocationName:"", TaskStatus:"IN PROGRESS",Author:"PATRICK SANDS",Editor:"THOMAS ANDERSEN",Created:"2/5/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"});
Set(NumberOfTickets,CountRows(TicketList))

 

2. Create Ticket Code

Set(NumberOfTickets,NumberOfTickets + 1);
Patch(TicketList,Defaults(TicketList),{Id:NumberOfTickets,
Title:CreateTicketScreenTitleText.Text,
Priority: CreateTicketScreenPriorityDropDown.SelectedText.Value,
Author:MyProfile.Mail,
TaskStatus:"NOT STARTED",
PercentComplete: "0",
Created:Now(),
AssignedTO:"",
Description:CreateTicketScreenTaskDescription.Text,
Editor:MyProfile.Mail,
Modified:Now(),
Category:CreateTicketScreenCategoryDropDown.SelectedText.Value });
Reset(CreateTicketScreenTitleText);
Reset(CreateTicketScreenTaskDescription);
Reset(CreateTicketScreenCategoryDropDown);
Reset(CreateTicketScreenPriorityDropDown);
Navigate(MyTicketsScreen,ScreenTransition.None)

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

You need to create a data source to replace the TicketList collection.  Then everywhere that a Patch is used to update TicketList you would update the new data source instead.  YOu can see the ClearCollect() statement in the OnStart.  That's what creates the collection and load the default tickets.  Then Patch() statement is what creates a new ticket in the collection. Those statements need to refer to a data source instead of a collection.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi  Pstork1 - Thank you.

Ok, i will create a new Sharepoint List and name it TicketList. 

I will then compete the rest of your suggestions and let you know how i get on.

Kind regards

Jerry

Hi, Thanks again for helping me.

  1. I have named the collection TicketList1, but it is still not saving the tickets i create when i log back in?
  2. When you said a new DataSource, did you mean new Collection or Sharepoint list?
  3. How can i remove the default ticket info, or should i leave?
  4. I also changed ClearCollect to Collect (Bold below) - am i wrong. I would have thought we wanted to collect the tickets.
  5. I have also replaced all the Patch with TicketList1

Looking forward to your response.

 

 

 

ClearCollect(TaskCategories,["CALL OUT REQUIRED","SPARE PART REQUIRED","TELEPHONIC ADVICE"]);
ClearCollect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED");
ClearCollect(TaskPriority,"HIGH","MEDIUM","LOW");
Set(MyProfile,Office365Users.MyProfile());
ClearCollect(AdminList,"jerry.haldane@atalianworld.com");
Collect(TicketList1,{Id:1,Title:"Fix Mouse",Description:"That is my cat!!!",Category:"CALL OUT REQUIRED",PercentComplete:"0.9",Priority:"HIGH",AssignedTO:"THOMAS ANDERSEN",TaskStatus:"COMPLETED",Author:"ScottK@contoso.com",Editor:"Scott Konersmann",Created:"2/8/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"},{Id:2,Title:"Replace keyboard", Description:"Please do it ASAP",Category:"SPARE PART REQUIRED",PercentComplete:"0.8",Priority:"LOW",AssignedTO:"YVONNE MCKAY", TaskStatus:"IN PROGRESS",Author:"PATRICK SANDS",Editor:"THOMAS ANDERSEN",Created:"2/5/2018 3:29 PM",Modified:"2/5/2018 3:29 PM"});
Set(NumberOfTickets,CountRows(TicketList1))

hi again, im so sorry for so many messages.

 

I understand you want me to create a new datasource. I have the existing HelpDesk Sharepoint which the installation instructions asked me to build. See below. I removed TicketList and replaced with HelpDesk but am then faced with errors. Is the below datasource what you were referring to?

 

Sharepoint.PNG

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 Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (4,211)