cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Best way to show only certain fields based on data source vale?

Hello,

I am in the process of building an IT Ticketing system, and for the most part, I've got the basics working (Form > Flow > SharePoint List > PowerApps ).

 

I'm currently in the early stages of setting up the app, to list view, detail view and edit the previously recorded IT issues from a Sharepoint List.

I've run into one major issue I'm not sure of the best way to handle:

 

I have 3 possible ticket types that my form can generate (Account changes (called account), Website issues (called website), and IT Related issue (Called IT ).

I can populate a variable with the value from the currently selected record, however I need/prefer a dynamic Details and Edit page that only shows the values that are relevant to each Ticket type.

 

I'm not sure if its best to create a full Scrollable screen for each record type that is customized to edit the previously selected record, or if I should just create a display/Edit form for each type on a single scrollable page, and only show the relevant form.

 

I'd like opinions on either option, or if there is a whole other better way to handle this then I currently am.

 

Also, I'd like to know how to hide a form based on the currently selected record from the Main window list view.

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @OC-ITServices ,

If you had three separate forms, you would do something like this on the OnSelect of the Gallery - I have called the Field below Issue - change to your name (and screen names)

Switch(
   ThisItem.Issue,
   "Account", Natigate(AccountScreen),
   "IT Issue", Natigate(ITIssueScreen),
   "Website", Natigate(WebsiteScreen)
)

The Item of each of the forms would be 

YourGalleryName.Selected

and the DataSource

IssueType

 

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

8 REPLIES 8
Highlighted
Community Support
Community Support

Hi @OC-ITServices ,

Could you tell me

1)whether these tickets data are saved in the same sharepoint list?

2)do you want to display detail form or edit form based on selected ticket?

I assume that all the tickets are saved in the same list.

If so, using one edit form and one display form is enough.

You just need to set the form's Item to:

Galleryname.Selected

Then the form will display the selected ticket's data.

If you want to open an edit form, set the navigate button like this:

EditForm(Formname)

If you want to open a display form, set the navigate button like this:

 

ViewForm(Formname)

 

Formula like this could change the form's mode.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

Hello,
Yes all tickets are stored into a single sharepoint list. Its a single form that users fill out for each issue, and the form only asks questions related to their problem. Flow then transfers those answers to a SP List, which I then suck into my power app.
I'm just trying to make the app somewhat intelligent where it doesn't bother showing me blank answers for unrelated problem types.

I'll try your recommendation and report back if I get it working or not.

tyvm!
Highlighted

Hello,

I started to try your recommendations, and I realise I dont think you understood my real question.

I know how to load data within both a form and button, however what I'm trying to do is the following:

 

I have a list of tickets. Each ticket can be either an account, website or IT issue. Each ticket has this set as a field option within the SP List called "IssueType".

What I would like, is that when I'm on the List view of tickets, if I click the > button, instead of loading a generic details page, it loads a record type specific details page.  What I'm not sure of, is if I should load a single scrollable screen with 3 forms on that scrollable page, and only make 1 of the 3 forms visible based on the ticket type, or should I have 3 whole scrollable pages for each ticket type, and have the > button send me to the correct page based on the ticket type.

I'm not sure if one is better then another (both performance/load time wise, best practices), and/or if both or either one of the options are even possible.

 

I've tried applying a formula to a form's visibility, but I always get an error:

The formula I've tried is:

 

If(LookUp(HelpDeskTickets,IssueType.Value) = string("account"),true,false)

 

But this always indicates an error of "Invalid argument type (text), Expecting a Boolean value instead.

Highlighted

Hi @OC-ITServices ,

If you had three separate forms, you would do something like this on the OnSelect of the Gallery - I have called the Field below Issue - change to your name (and screen names)

Switch(
   ThisItem.Issue,
   "Account", Natigate(AccountScreen),
   "IT Issue", Natigate(ITIssueScreen),
   "Website", Natigate(WebsiteScreen)
)

The Item of each of the forms would be 

YourGalleryName.Selected

and the DataSource

IssueType

 

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

Highlighted

Hi @OC-ITServices ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Highlighted

Thanks Warren,

 

I only had a chance to work on this now, I tried to implement it but I get:

OC-ITServices_0-1594780666127.png

 

It seems as though Switch cant evaluate the current item due to scope.

Highlighted

Hi @OC-ITServices ,

The issue is not Switch - it is saying ThisItem is not available from where you are running this code. ThisItem only applies to controls inside a gallery or form - where is your situated?

Highlighted

Hi @OC-ITServices ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,423)