cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerStar321
Helper II
Helper II

submit button's visible property not working the second time you use form using launch

Hi All,

 

I have a PowerApps form that has a submit button to add a new record to a SharePoint list. It also has a "would you like to submit another item" toggle switch. This reloads the same PowerApps form by using Launch so the user can add a new record. It all works perfectly except the validation on the submit button's visible property. I use the code below to hide the button if certain fields are not added properly or are left blank. This all works perfectly when you open the PowerApps form for the first time, but when you reload the form to add a new record it doesn't work. Is this a bug or am I doing something wrong? 

 

If(
(IsBlank(DataCardValue1.Text)) || (IsBlank(DataCardValue3.Text)) || (IsBlank(DataCardValue2.SelectedItems)) || (IsBlank(DataCardValue4.SelectedItems)) || (IsBlank(DataCardValue7.SelectedItems)) || (IsBlank(DataCardValue6.SelectedItems)) || (IsBlank(DataCardValue8.SelectedItems)) || (IsBlank(DataCardValue10.SelectedItems)) || (IsBlank(DataCardValue5.SelectedItems)) || (!(IsMatch(
DataCardValue1.Text,
"^[a-zA-Z ]*$"
))) || (!(IsMatch(
DataCardValue3.Text,
Email
))),
false,
true
)

 

I hope you can help

Colin

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi@PowerStar321,

Based on the issue that you mentioned, do you want to validate the submit button visibility based on the condition?

Could you please share a bit more about the scenario?

I think there is something syntax wrong with the DataCardValue.SelectedItems , please modify your formula as below.

If(
(IsBlank(DataCardValue1.Text)) || (IsBlank(DataCardValue3.Text)) 
|| (IsBlank(DataCardValue2.SelectedItems) || IsEmpty(DataCardValue2.SelectedItems)) 
|| (IsBlank(DataCardValue4.SelectedItems) || IsEmpty(DataCardValue4.SelectedItems)) 
|| (IsBlank(DataCardValue7.SelectedItems) || IsEmpty(DataCardValue7.SelectedItems)) 
|| (IsBlank(DataCardValue6.SelectedItems) || IsEmpty(DataCardValue6.SelectedItems)) 
|| (IsBlank(DataCardValue8.SelectedItems) || IsEmpty(DataCardValue8.SelectedItems)) 
|| (IsBlank(DataCardValue10.SelectedItems) || IsEmpty(DataCardValue10.SelectedItems)) 
|| (IsBlank(DataCardValue5.SelectedItems) || IsEmpty(DataCardValue5.SelectedItems)) 
|| (!(IsMatch(DataCardValue1.Text,"^[a-zA-Z ]*$"))) 
|| (!(IsMatch(DataCardValue3.Text,Email))
),
false,
true
)

Hope it could help.

Regards,

Qi

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi@PowerStar321,

Based on the issue that you mentioned, do you want to validate the submit button visibility based on the condition?

Could you please share a bit more about the scenario?

I think there is something syntax wrong with the DataCardValue.SelectedItems , please modify your formula as below.

If(
(IsBlank(DataCardValue1.Text)) || (IsBlank(DataCardValue3.Text)) 
|| (IsBlank(DataCardValue2.SelectedItems) || IsEmpty(DataCardValue2.SelectedItems)) 
|| (IsBlank(DataCardValue4.SelectedItems) || IsEmpty(DataCardValue4.SelectedItems)) 
|| (IsBlank(DataCardValue7.SelectedItems) || IsEmpty(DataCardValue7.SelectedItems)) 
|| (IsBlank(DataCardValue6.SelectedItems) || IsEmpty(DataCardValue6.SelectedItems)) 
|| (IsBlank(DataCardValue8.SelectedItems) || IsEmpty(DataCardValue8.SelectedItems)) 
|| (IsBlank(DataCardValue10.SelectedItems) || IsEmpty(DataCardValue10.SelectedItems)) 
|| (IsBlank(DataCardValue5.SelectedItems) || IsEmpty(DataCardValue5.SelectedItems)) 
|| (!(IsMatch(DataCardValue1.Text,"^[a-zA-Z ]*$"))) 
|| (!(IsMatch(DataCardValue3.Text,Email))
),
false,
true
)

Hope it could help.

Regards,

Qi

Best Regards,
Qi

Thanks Qi

 

Thant worked perfectly !

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,960)