cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
maxvr
Frequent Visitor

Required property for Custom Data Card in Form

Hello everyone,

 

I have built a canvas app and inserted a Form. The data source for this Form is SharePoint list. 

When the Data Card is added from SP list column - required functionality is set up super easily and works as a charm on Submit button action. This is how it looks for data card from SP: 

maxvr_0-1626264128040.png

 

1. For data card I am making it required only if it's visible
    -> Topic_DataCard Required property:  If('Topic_DataCard'.Visible = true, true, false)

2.  ErrorMessage17 Text is set up to:  If(IsBlank(Parent.Error), "", "* This field is required")

3. No special property for Topic_ComboBox 

 

What is the issue: now I have a need to add a Custom Data card for this Form and make it required upon Submitting. 

maxvr_1-1626265779603.png

 

maxvr_2-1626266129033.png

 

When Custom Data Card added, I insert TextInput or Combobox to it. Setting all properties as above but it's not working. User is able to submit Form bypassing new field when value is empty. 

1. For Custom Data Card I am making it required as well only if it's visible 
    -> 43_SourceFunds Required property: If('43_SourceFunds_DataCard'.Visible = true, true, false)

2.  43_ErrorMessage Text is set up to:  If(IsBlank(Parent.Error), "", "* This field is required")

3. No special property for 43_SourceFunds_ComboBox. Note

 

maxvr_3-1626266630843.png

 

Submit button OnSelect: If(Form.Valid= true, SubmitForm(Form);ResetForm(Form);Navigate(Screen_ThankYou),SubmitForm(Form));

 

Could anyone help to figure out what/how I can fix this? Is there a workaround? 

 

Thanks in advance,

Max

7 REPLIES 7
Drrickryp
Super User
Super User

@maxvr 

Is there a field in your SharePoint list that corresponds to the custom card you have added to the form?  If there is, can you select that field from the  fields list on the right side of the screen when the form is selected?

StalinPonnusamy
Community Champion
Community Champion

Hi @maxvr 

 

I tested this use case. As you stated, Card visible property works fine but not validating data. Another option is to verify the field (combo box) specifically like

If(
    EditForm1.Valid && !IsBlank(ComboBox2.Selected.Value),
    SubmitForm(EditForm1),
    UpdateContext({formstatus: "Form is not valid"})
)

 

maxvr
Frequent Visitor

Hi @Drrickryp 

Thanks for looking into this. 

I think this is the issue - there is no Update property when adding custom card. So I can not refer it to any field in my SharePoint. It could be a bug from MS side from what it looks like.  

 

maxvr_0-1626771098373.png  

 

maxvr_2-1626771179042.png

 

 

 

 

Drrickryp
Super User
Super User

@maxvr 

That is by design. You must have a field (column) in your list in order to update it's data. If you add a new field to your list you will find it has been automatically added to the list of fields that you can add as cards.

StalinPonnusamy
Community Champion
Community Champion

Hi @maxvr

 

I'm not sure you explained already. Please explain what is your goal to have a data card in the edit form but not having a field in the SP list. So that we can help better.

Hi @StalinPonnusamy 

 

This is exactly the case. The goal is: 

1. to have Custom DataCard in the edit form but not having a field in SP list

2. and for the Require functionality of this DataCard  to work. 

Drrickryp
Super User
Super User

@maxvr 

I don't think you can use the built in validation method without an actual field in your list.  PowerApps uses the card's update property to check against missing data in a required field.  You can do a workaround by making the visibility or display property of the button for submitting the form dependent upon some value in a control in your custom card.  You could also put a label in the custom card saying "a selection is required"

!IsBlank(somedropdowncontrol)// visible property of button or

If(IsBlank(somedropdowncontrol),Disabled,Edit)// displaymode property

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,865)