cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
knutarst
Level: Powered On

Service Desk Example

When I change the status to Closed the DateClosed field in the Tickets spreadsheet is updated to the current date. When I change the status from Closed the DateClosed field is updated with a blank date. Can someone help me find the sourcecode that update this DateClosed field?

3 REPLIES 3
Power Apps Staff cherie
Power Apps Staff

Re: Service Desk Example

Hi,

 

The formula in for the Save button is as follows

 

If(TextBox5_25.Text<>"Closed", UpdateIf(TicketsCollect1,ID=EditRecord.ID,{Status:TextBox5_25.Text,AssignedTo:assign,DateClosed:"--",AccountName:TextBox5_59.Text,Priority:TextBox5_60.Text,Subject:TextInput2.Text,Description:TextInput4.Text,Comment:TextInput3.Text}),UpdateIf(TicketsCollect1,ID=EditRecord.ID,{Status:TextBox5_25.Text,AssignedTo:assign,DateClosed:TextBox3.Text,AccountName:TextBox5_59.Text,Priority:TextBox5_60.Text,Subject:TextInput2.Text,Description:TextInput4.Text,Comment:TextInput3.Text}));Navigate(DashboardPage,ScreenTransition.Fade)

The key part is that the DateClosed is set to "--" if the status text box is not "Closed"

 

Hope this helps! (I hope this is what you were looking for, if not please let me know!)

 

Also, if you go to web.powerapps.com, the examples we have now give you the option to make the app a copy of the app, so you can inspect the formulas for the app.

 

Cherie

knutarst
Level: Powered On

Re: Service Desk Example

Thank you for your reply Cherie,
Unfortunately, I do not find this formula in the Save button.

I have created my App from the Service Desk template, with phone layout.
In this app I have a save button on the TicketsDetailsPage but the formula on the OnSelect event for this button is only: SubmitForm(TicketDetailsForm).
However, I have the following formula in the Default field on the TicketsDetailsPage: If(IsBlank(EditRecord.DateClosed);"--";EditRecord.DateClosed)

In this App I do not have a DashboardPage either, but I can see from your formula that you have Navigate(DashboardPage,ScreenTransition.Fade). This make me believe that we are looking at different examples.

Power Apps Staff cherie
Power Apps Staff

Re: Service Desk Example

@knutarst, I suspect you are using an older template, you could recreate it from web.powerapps.com.

 

However, what you can do is update the EditRecord in the OnChange property for the ticket status

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,581)