cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

SubmitForm with CDS OptionSet not working to update a record

Hi Community

I can use some help on following issue. I'm trying to update a record in CDS using a Form. But it errors on some fields are not a valid format or missing required field. It should be something with the fields that has an OptionSet as fieldtype. 
SubmitForm is working to submit a new record with Form Item Property set to Defaults(Menio).
But when I try to update an existing record with it fails. Is this normal behavior and should I look for using Patch or Update?
Or do I miss something here?

Thanks for helping out!
Bart


BClouded_0-1600083000285.png

 

6 REPLIES 6
Dual Super User II
Dual Super User II

Hi @BClouded 

 

Can you share more details about the error that you are getting? What do you have in the Update property of the Option Set type field datacard? Also, when you are saving the new record, is it saving the value for Option Set? If you can share more details, we might be able to help you better.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi
This is the error message

BClouded_0-1600088889241.png

This is the Form

BClouded_2-1600088981233.png

The Update Property for those Dropdowns are: DataCardValue36.Selected.Value
It's basically just a default form I inserted. I only updated the Item property of the form to this: 
If(addNewMenio, Defaults(Menios), selMenioRec).
selMenioRec, is set by ThisItem.Menio (Menio is a lookup field in the Client entity, thisItem is a record in the Client Entity)

Hope this helps for understanding better! Thanks for thinking with me. Much appreciated!

Bart

Super User II
Super User II

Additionally, can you confirm that your Form is in FormMode.Edit? https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-form

 

I have done this by accident a few times, and have seen similar errors, since Forms will handle New vs. Edit differently. Is that Form's mode being set dynamically? Have you tried any of the explicit form 'resets' noted in the doc above?

Hi @BClouded 

 

Can you update the expression to:

 

If(addNewMenio, Defaults(Menios), LookUp(Menios, Menio = selMenioRec))

I am assuming that Menio is the name of column.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

That didn't helped either.
I ultimately removed the whole form and readded it. It now seems to function normally.
What could have been the issue or the trigger, is that I changed the entity to include attachments in CDS later on. Of course I refreshed my datasources in the App, but to  no avail.
Anyway is seems to function now! Thanks for your time mate! 

@BClouded 

 

Sometimes these issue occurs because of caching. Whenever you think, that there is something which is behaving strangely, clear the cache of your browser, logout and login again. It usually resolves the caching issue. If your issue is resolved, please accept the solution so that it is helpful for others having the same issue.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (30,696)