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

Help with PowerApp Form

Hi

I have some questions

 

I have Section A in my form which needs to be electronically signed by the person completing the form and that user needs to be input there line manager name/email.

I am then planning on using a work flow to alert the line manager they have section B to complete, hopefully if I can create a task for them, but I'm curious how I get this to work?

I don't want the user to complete Section B, in fact I don't even want them to see it, but when the form is emailed to the line manager I want both Section A and Section B to be visible to them.

Also as the data will reside in a SPO list, what's stopping the end user going to the list and manually completing section B.... I don't anticipate them doing this and versioning enabled will leave a trail as to who completed this, but would prefer if possible the user is now able to?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @G99 ,

Could you please share a bit more about your Form?

 

Based on the needs that you mentioned, I think you could consider visible the Section B based on conditions. You could consider set up a colelction within your app to store all available Line Manager Names/Emails.

When any one user use your app, check if the current user is in the available Line Manager Names/Emails collection, if yes, it means that current user is a Line Manager, then Section B would be visible to him, if not, it means that current user is a common user, then Section B would be hidden to him.

 

Set the OnStart property of App to following:

ClearCollect(
              LineManagers, 
              {Name: "LM1", Email: "LM1@email.com"},
              {Name: "LM2", Email: "LM2@email.com"},
              {Name: "LM3", Email: "LM3@email.com"},
              {Name: "LM4", Email: "LM4@email.com"}
)

Then set the Visible property of each field data card in your Section B part to following:

If(
   User().Email in LineManagers.Email,
   true,
   false
)

then save, publish and re-load your app, check if it works well.

Note: Please share your app to your end users (including Line Managers) with Users permission rather than Co-Owner permission.

 

If you want to email the Line Manager when the Section A part is completed, I think the MS Flow (Power Automate) could achieve your needs. On your side, you could consider set up a ms flow, then add a "When an item is created" trigger of SP connector as the Trigger, then add a "Send an email" action of Outlook connector to send email to the Line Manager (which you could get from the "When an item is created" trigger), within the Body field, type the Web Url of your canvas app along with specific parameter (e.g. ?ID=..).

Within your app, add the following formula within the OnStart property of App:

Set(ItemID, Param("ID"));
If(
   !IsBlank(ItemID),
   Navigate(FormScreen)
)

Please check and see if the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Embedded-link-to-a-Sharepoint-List-...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Editing-a-record-from-a-flow-powera...

 

When the Line Manager receives the email, he could click the embedded url link to open your canvas app.

 

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

2 REPLIES 2
Community Support
Community Support

Hi @G99 ,

Could you please share a bit more about your Form?

 

Based on the needs that you mentioned, I think you could consider visible the Section B based on conditions. You could consider set up a colelction within your app to store all available Line Manager Names/Emails.

When any one user use your app, check if the current user is in the available Line Manager Names/Emails collection, if yes, it means that current user is a Line Manager, then Section B would be visible to him, if not, it means that current user is a common user, then Section B would be hidden to him.

 

Set the OnStart property of App to following:

ClearCollect(
              LineManagers, 
              {Name: "LM1", Email: "LM1@email.com"},
              {Name: "LM2", Email: "LM2@email.com"},
              {Name: "LM3", Email: "LM3@email.com"},
              {Name: "LM4", Email: "LM4@email.com"}
)

Then set the Visible property of each field data card in your Section B part to following:

If(
   User().Email in LineManagers.Email,
   true,
   false
)

then save, publish and re-load your app, check if it works well.

Note: Please share your app to your end users (including Line Managers) with Users permission rather than Co-Owner permission.

 

If you want to email the Line Manager when the Section A part is completed, I think the MS Flow (Power Automate) could achieve your needs. On your side, you could consider set up a ms flow, then add a "When an item is created" trigger of SP connector as the Trigger, then add a "Send an email" action of Outlook connector to send email to the Line Manager (which you could get from the "When an item is created" trigger), within the Body field, type the Web Url of your canvas app along with specific parameter (e.g. ?ID=..).

Within your app, add the following formula within the OnStart property of App:

Set(ItemID, Param("ID"));
If(
   !IsBlank(ItemID),
   Navigate(FormScreen)
)

Please check and see if the following threads would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Embedded-link-to-a-Sharepoint-List-...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Editing-a-record-from-a-flow-powera...

 

When the Line Manager receives the email, he could click the embedded url link to open your canvas app.

 

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

Hi @v-xida-msft 

Thanks for this, I didn't get a chance to try this as was waiting on a service account to use with Flow

I've created a collection and added myself as the manager, then set section B to be visible to only the users in the collection.

I'm unsure what the suggestion to add the Fx to the on start property achieves can you explain please?

 

Furthermore, if you can help, it now appears that the users should be able to see Section B  but not be able to edit it, only view, i'm unsure how to edit the Fx to reflect this, I believe I need to use Edit = True, DisplayMode.Edit , DisplayMode.View but unsure how to add this together with looking at the collection for users that are only included in the collection to be able to edit?

Helpful resources

Announcements
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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