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 Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,819)