cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vindesaicoding
Level: Powered On

How do I ensure text input fields and a pen input has data before sending to a SharePoint list?

I have the following code taken from the OnSelect property of a submit button. 


The final edit form (frmReportAccident3) has two text input fields (which gets sent to one SharePoint list) and a pen input (that runs a Flow that sends a signature to another SharePoint list). 

What do I need to do to this code to make sure the two fields and the pen input have data to send, before sending to SharePoint?

Capture-1.PNG

3 REPLIES 3
GarethPrisk
Level: Powered On

Re: How do I ensure text input fields and a pen input has data before sending to a SharePoint list?

The PenInput control is a bit finicky. I recommend:

  • Set ShowControls = false
  • Add a Button/other control to Reset(PenInput), to allow them to 'Reset It'
  • Add an OnSelect to toggle a variable (such as locSigned) to true
    • Be sure to toggle the variable to false, if they reset it
    • Default the variable to false, and it will be toggled when they sign
  • Use the variable to determine if the control has been interacted with

The other ones are straight-forward.

  • Check the Data Card for the text inputs, and see what their Update properties are
  • Wrap that value in IsBlank() or IsEmpty() (depending on type)
  • This will give you a Boolean check to determine if they have data
vindesaicoding
Level: Powered On

Re: How do I ensure text input fields and a pen input has data before sending to a SharePoint list?

Thanks,

I'm working through this now, but I'm stuck on the third bullet point.

"Add an OnSelect to toggle a variable (such as locSigned) to true

  • Be sure to toggle the variable to false, if they reset it
  • Default the variable to false, and it will be toggled when they sign"

Can you please explain how to do these points and the points that follow so that it's clear to me?

GarethPrisk
Level: Powered On

Re: How do I ensure text input fields and a pen input has data before sending to a SharePoint list?

Sure thing!

On your PenInput control

  • Select the OnSelect property, and set it equal to
  • UpdateContext({locSigned: true})

On your button, or whatever you add to 'Reset' the PenInput

  • In the function, or on the OnSelect property, set it equal to
  • UpdateContext({locSigned: false})

 

Now you have a context variable locSigned, which you can check to see the PenInput was used (signed).

  • If(locSigned, "Do This When Signed", "Do This When Not Signed")

 

Here's MSFT Docs on variables, as well.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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