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

Formula not working for me

Hi,

 

Problem Statement: In a SharePoint list, I am customzing a form. I want certain validations for onSave event. Like whenever a user clicks on save button, if a toggle is checked, attachments will be mandatory for him to upload.   

 

I tried executing the following formula on onSave event of powerapps:

 

If(_checkedToggleCount> 0 && IsEmpty(DataCardValue69.Attachments),  Set(warningText, "Attachments Missing"), _checkedToggleCount= 0, SubmitForm(SharePointForm1) )

If a user clicks on save without uploading an attachment, a label is updated with the correct text.( first part of the formula),

But then if user tries to upload attachment and save the item still the item is not saved. 

 

I have just started with powerapps formuals, any idea where I could be going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Formula not working for me

Hi,

 

Could you please explain a bit for the parameter used in your formula?

If(_checkedToggleCount> 0 && IsEmpty(DataCardValue69.Attachments),  Set(warningText, "Attachments Missing"), _checkedToggleCount= 0, SubmitForm(SharePointForm1) )

Specially for _checkedToggleCount, and the DataCardValue69.Attachments?

By the way, what is the meaning of "

_checkedToggleCount= 0

"?

I don't think it will work if you want to set the value to 0 for _checkedToggleCount.

The value should be updated by UpdateContext() or the set() function.

 

I suspect the issue here should be mostly related to the _checkedToggleCount.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
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

1 REPLY 1
Community Support Team
Community Support Team

Re: Formula not working for me

Hi,

 

Could you please explain a bit for the parameter used in your formula?

If(_checkedToggleCount> 0 && IsEmpty(DataCardValue69.Attachments),  Set(warningText, "Attachments Missing"), _checkedToggleCount= 0, SubmitForm(SharePointForm1) )

Specially for _checkedToggleCount, and the DataCardValue69.Attachments?

By the way, what is the meaning of "

_checkedToggleCount= 0

"?

I don't think it will work if you want to set the value to 0 for _checkedToggleCount.

The value should be updated by UpdateContext() or the set() function.

 

I suspect the issue here should be mostly related to the _checkedToggleCount.

 

Regards,

Michael

 

Community Support Team _ Michael Shao
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

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,109)