cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
coffee_fan
New Member

Error Message Label setup for fields that source from dependency mapping table for Customize SharePoint Form

Hi, 

I'm a newbie for PowerApps and not hard core developer but an analyst with some coding skills. Instead of building a standalone application with SharePoint form from scratch, I went the easy way of using "Integrate - Power Apps - Customize Forms". Now I'm hitting a blocker to resolve the error I have below.

 

What I try to build:

I have fields that the selection list shall based on other fields selection, and I have loaded a 2nd source of excel where I have 3 mapping tables to use, A-B mapping, B-C mapping, B-D mapping

- A is single selection, B is multi selection, C is single selection, D is single selection

- I have leverage Item property for B, C, D and fulfilled the dependency sample code as:

 

If(DataCardValue28.Selected.Value = Blank(), A-B Mapping.B,Filter(A-B Mapping, 'A' = DataCardValue28.Selected.Value))

If(DataCardValue1.Selected.Value = Blank(),Distinct(B-C Mapping,'C'),Distinct(Filter(B-C Mapping, B in Concat(DataCardValue1.SelectedItems,Value,",")),'C'))

 

- I had issue where the form process fine and allow submission, but when I see the SharePoint list for the record submitted, it was having issue and all 3 dependent selection fields are showing blank value submitted.

- Then I found there are suggestion to use Update property for the 3 fields so it ensure value from other source configured through into SharePoint list and it worked, sample code as:

 

If(Not(IsBlank(DataCardValue1.Selected.Value)),{Value: Concat(DataCardValue1.SelectedItems,B,";#")})

 

- Now the real issue is around the ErrorMessage for the 3 datacard. For any submitted SharePoint record, when I try to edit/update the record for other fields excluding the 3 dependent fields and submit the update by clicking Save, my Save button have OnSelect = SubmitForm(SharePointForm1). The form is preventing me from submission and throwing error message stating for all 3 dependent fields, even though I already have value selected as this was submitted before. Sample screen

coffee_fan_0-1660827856720.png

 

Hope the entire background of issue is not overwhelming. I tend to provide as much information as possible to increase efficiency. And pardon me to blur the form just in case, but hope its clear enough for illustration.

 

 

8 REPLIES 8
JR-BejeweledOne
Super User
Super User

Your form fields appear to be required.   If you are trying to submit the form and the default fields in the data card are empty, you will get an error.  

 

Did you set the Default property for the DataCardValueX to the value of the dropdown?   

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

yes, those fields are required. But he error message is populating when I opened an submitted request and try to update it and the resubmit it (the update is not touching the required fields which already have values) and the error message persist showing while the filed required is Not Empty

I did not set the Default property of the value, thats blank, is that the reason? What should I set it for then?

JR-BejeweledOne
Super User
Super User

It has to do with the required value.   I can see that in the error message. 

 

Your default formula for that DataCardValue should look something like this.

 

If(
SharePointForm1.Mode = FormMode.View, Parent.Default,
DDXXX.Selected.Value
)

 

The default value of your dropdown should also look something like this:

If(
!(SharePointForm1.Mode = FormMode.New), Parent.Default

)

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

I got both error for formula when adjust the Data Card(dropdown) Default and the datacardvalue default. Also for the data card default I have ThisItem.XX in default. but the datacardvalue default is blank

I got both error for formula when adjust the Data Card(dropdown) Default and the datacardvalue default. Also for the data card default I have ThisItem.XX in default. but the datacardvalue default is blank

JR-BejeweledOne
Super User
Super User

In forms, the default value is typically set to Parent.Default.  This gives you the value of the field in your SharePoint list.

 

When you want to reference that value, you should use Parent.Default.   There are a couple different ways you can do this.

 

Try this:   Set the default value of DataCardValueX to your dropdown.   DDxxx.Selected.xxx

 

Then set your dd default value like this (If this is a combobox, use the DefaultSelectedItems property):

 

If(
  SharePointForm1.Mode <> FormMode.New, Parent.Default
) 

 

This will set the value of the dropdown to the saved value if the form is in View or Edit mode and should leave it blank if the form is in New mode.

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Thanks so much for your quick response JR-BejeweledOne, but the default property does not work out for me. I guess my situation is a bit complex, where all three fields are dependent selection field where the selection value is not coming directly from SP list, but from my Mapping tables. Hence I was using Update property for all dependent card and concat value at submission so it's not showing as missing/blank on SP list. Given this action, it mess up the value captured in the field and when retrieve existing record, the field is actually displaying a string of concat value but tags values of selections... So when clicking on Save again without change, some sort of conflict result in parent error and triggered the message and prevent submission of form....

 

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (4,296)