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
Super User
Super User

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
Super User
Super User

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
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.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (4,309)