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

submit form- 3 different detail forms

i have to create a power app for the sales force built off of sharepoint.

 

There are 3 different types of sales rep (A/B/C). Depending on which rep they are they will select ABC and answer fields/questions that only pertain to them. No questions are the same for each rep.

 

Here is the issue.

When they want to view/edit their respective entry they only see the default fields (sales rep level + name). In the details form/answer screen they should only see the fields that they responded to. I can do it manually but no rep (A/B/C) has the same level or same questions so what they see can only pertain to their level.

 

Do i have to create 3 different answer screens/detail forms for each Sales rep(A/B/C)?

 

What would be the best way to go about this?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anon622 ,

Have you bind the Display Form to a specific record you want to preview from your SP List?

 

Firstly, just as I mentioned above, it is not necessary to create three Display forms/Edit forms for each Sale Rep Type (A/B/C), instead, single one Display form/Edit form is enough.

Within your Display form/Edit form, enable all related field data cards for three Sale Rep Types, and then control the visible of each field data card based on the variable you set up through the three buttons. Set the OnSelect property of the "RepA" button to following:

Set(RepGlobal, "RepA");
Navigate(EditScreen)

Set the OnSelect property of the "RepB" button to following:

 

Set(RepGlobal, "RepB");
Navigate(EditScreen)

 

Set the OnSelect property of the "RepC" button to following:

 

Set(RepGlobal, "RepC");
Navigate(EditScreen)

 

Within your Edit screen, control the visible of each field data card based on the RepGlobal variable. e.g. set the Visible property of all "RepA" related field data cards to following:

If(
   RepGlobal = "RepA" || IsBlank(RepGlobal),
   true,
   false
)

 

set the Visible property of all "RepB" related field data cards to following:

If(
   RepGlobal = "RepB" || IsBlank(RepGlobal),
   true,
   false
)

set the Visible property of all "RepC" related field data cards to following:

If(
   RepGlobal = "RepC" || IsBlank(RepGlobal),
   true,
   false
)

 

In addition, if you want to preview record value in your Edit form, please also make sure the Item property of the Edit form has been bind to a specific record you want to edit from your SP List. If there is a BrowseGallery in your app to list all available records, please set the Item property of the Edit form to following:

BrowseGallery1.Selected

If you custom the form in your SP List using PowerApps, please set the Item property of the Edit form to following:

If(
   IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
   First([@'Your SP List']),
   SharePointIntegration.Selected
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

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

View solution in original post

6 REPLIES 6
Drrickryp
Super User
Super User

Hi @Anon622 

You could do it with 3 screens each one specific for a particular sales rep type or you could use one form with all of the items but set the Visible property of each card to salesrepA, salesrepB, or salesrepC.  Then, use a Set() function to indicate which type they are in the OnStart property of the app. 

I already have a Set function set up in the HomeScreen. There are 3 buttons for each Sales Rep (A/B/C) and once a button is selected it 'sets' that rep up as either A/B/C. 

 

What would i use for the visible property function?

The same name that you set the variable to.

Hi @Anon622 ,

Based on the needs that you mentioned, I think it is not necessary to create three different Edit forms for each Sales Rep. I think single one Edit form/Display form could achieve your needs.

 

You could consider add a single one Edit form in your app, connect it to your SP List data source. Then enable all related field data cards for all three Sales Rep types.

 

Set the OnSelect property of Sales Rep A button to following:

Set(SelectedSaleType, "RepA")

Set the OnSelect property of Sales Rep B button to following:

Set(SelectedSaleType, "RepB")

Set the OnSelect property of Sales Rep C button to following:

Set(SelectedSaleType, "RepC")

 

Go to your Edit form, then set the Visible property of these Sales Rep A type related field data cards to following:

If(
   SelectedSaleType = "RepA",
   true,
   false
)

then set the Visible property of these Sales Rep B type related field data cards to following:

If(
   SelectedSaleType = "RepB",
   true,
   false
)

then set the Visible property of these Sales Rep C type related field data cards to following:

If(
   SelectedSaleType = "RepC",
   true,
   false
)

after that, you could control the field data cards visible in your Edit form based on the which Sales Rep button you clicked.

 

Best regards,

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

Thanks for the assistance. I tried that but when i got to the edit fields part i hit a roadblock. I wasn't able to view the fields in the form despite them showing in the fields list. Where do you go from here?

 

For context:

Prior to your advice i was using this Set function in the homescreen via 3 buttons:

Set(RepAglobal, "RepA"); Navigate(EditForm1,Fade)

Set(RepBglobal, "RepB"); Navigate(EditForm2,Fade)

Set(RepCglobal, "RepC"); Navigate(EditForm3,Fade)

 

I tried

 

 

Hi @Anon622 ,

Have you bind the Display Form to a specific record you want to preview from your SP List?

 

Firstly, just as I mentioned above, it is not necessary to create three Display forms/Edit forms for each Sale Rep Type (A/B/C), instead, single one Display form/Edit form is enough.

Within your Display form/Edit form, enable all related field data cards for three Sale Rep Types, and then control the visible of each field data card based on the variable you set up through the three buttons. Set the OnSelect property of the "RepA" button to following:

Set(RepGlobal, "RepA");
Navigate(EditScreen)

Set the OnSelect property of the "RepB" button to following:

 

Set(RepGlobal, "RepB");
Navigate(EditScreen)

 

Set the OnSelect property of the "RepC" button to following:

 

Set(RepGlobal, "RepC");
Navigate(EditScreen)

 

Within your Edit screen, control the visible of each field data card based on the RepGlobal variable. e.g. set the Visible property of all "RepA" related field data cards to following:

If(
   RepGlobal = "RepA" || IsBlank(RepGlobal),
   true,
   false
)

 

set the Visible property of all "RepB" related field data cards to following:

If(
   RepGlobal = "RepB" || IsBlank(RepGlobal),
   true,
   false
)

set the Visible property of all "RepC" related field data cards to following:

If(
   RepGlobal = "RepC" || IsBlank(RepGlobal),
   true,
   false
)

 

In addition, if you want to preview record value in your Edit form, please also make sure the Item property of the Edit form has been bind to a specific record you want to edit from your SP List. If there is a BrowseGallery in your app to list all available records, please set the Item property of the Edit form to following:

BrowseGallery1.Selected

If you custom the form in your SP List using PowerApps, please set the Item property of the Edit form to following:

If(
   IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
   First([@'Your SP List']),
   SharePointIntegration.Selected
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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