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.
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.
Solved! Go to Solution.
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.
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.
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:
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.
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?
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
179 | |
51 | |
47 | |
32 | |
32 |
User | Count |
---|---|
266 | |
91 | |
78 | |
68 | |
67 |