cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NurNina
Post Patron
Post Patron

Edit activity in canvas apps

Hi, I have a gallery containing my list of activities from activity entity (cds). There are many activity type inside this activity entity like Task, phone calls and appointments. 

activities.PNG

What i am trying to do here is to make an edit page for each activity type. For example, when user click on activity type =Task, user will be directed to edit task page. 
How do I do that? 

I try to use If function. however, it has error saying invalid argument type (optionsetvalue).expecting a boolean value.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

this one.PNG

@WarrenBelz this is the text property of the field.

View solution in original post

Hi @NurNina ,

The answer is actually in that formula

If(
   IsType(ThisItem[@Tasks]), Navigate(TaskScreen),
   IsType(ThisItem[@'Phone Calls']), Navigate(PhoneCallScreen),
   IsType(ThisItem[@'Email Messages']), Navigate(EmailScreen),
   IsType(ThisItem[@Appointments]), Navigate(AppointmentScreen)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

9 REPLIES 9
WarrenBelz
Super User
Super User

Hi @NurNina ,

On the OnSelect of the gallery

If(
   ThisItem.Task = "Activity",
   Navigate(ActivityScreen),
   ThisItem.Task = "Phone Call",
   Navigate(PhoneCallScreen),
   ThisItem.Task = "Appointment",
   Navigate(AppointmentScreen)
)
and so on

Replace with your names where necessary.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

@WarrenBelz is it something like this? however i have an error saying that it is incompatible type. 
type.PNG

HI @NurNina ,

I cannot see your data, but Activity is obviously not a Text field in your data source.

I am also assuming you have put this code on the OnSelect of the Gallery.

Put a another dot  ThisItem.Activity. and see if any choices come up at the bottom.

You really only need to establish what the user has chosen from the gallery fields and use this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz It is actually the Activity Type. but when I try to use it, it says that the identifier isnt recognized. When I check inside the cds, there's no field called Activity Type. This is from the model driven side: 

 

act type.PNG

 

 

 

HI @NurNina ,

What is the reference to the field in the gallery? It needs to be in the gallery for the ThisItem.Selected.xxxx to work.

@WarrenBelz Can I do it on a button instead of the gallery ?

Hi @NurNina ,

It really does not matter - the user has selected an item in the gallery - you have to find out the activity type that was selected. That need to be in a field somewhere in the data source of the gallery. It does not have to be displayed, but it must be in Items data source, otherwise you have not way of knowing which Activity Type the user has selected.

I am assuming you are referring to CDS rather then Model Driven as this is a canvas app.

I can see the field in the gallery - what is the Text property of that field?

 

 

this one.PNG

@WarrenBelz this is the text property of the field.

Hi @NurNina ,

The answer is actually in that formula

If(
   IsType(ThisItem[@Tasks]), Navigate(TaskScreen),
   IsType(ThisItem[@'Phone Calls']), Navigate(PhoneCallScreen),
   IsType(ThisItem[@'Email Messages']), Navigate(EmailScreen),
   IsType(ThisItem[@Appointments]), Navigate(AppointmentScreen)
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,846)