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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

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

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (2,913)