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.

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,982)