+ Start a Discussion
Mario CMario C 

Screen Flow Error while creating record

I am creating a rather complex questionnaire in flow. 

I've noticed a rather odd behaviuor...see the following example:

Q1. Do you have kids?
Yes/No (choice Yes=Truie, choice No=False)

Q2. are you kids at school? (the component visibility for this Q is set if Q1=Yes)
Yes/No

Now, I can finally create a kids profile record

The Kids Profile object includes Q1 and Q2 checkboxes so that I can map to the actual screen questions.

Here is the problem, if I map both Q1 and Q2 on the create records component, but the response for Q1 happens to be No, Q2 gets skipped and in the debug Q2 results to be a null, and consequently a  INVALID_TYPE_ON_FIELD_IN_RECORD error will occur. 

Considering that I know why the error is being triggered, I believe that for a screen funtionality, there should actually be something that ignore the mapping for skipped questions; I can't believe this is not a stardad functionality...

Please let me know if it's just me that I am missing something or it's really like that. 
 

Andy Kallio 13Andy Kallio 13
Hi Mario. 
Sounds strange. Without seeing your flow I suggest trying to setting up your insert differently. There's a couple different ways to do it.
you can:
  • use an Assignment element to populate an sobject variable with your screen values and then use and Insert element (Create records) toinsert the variable
  • Or, simply use an Insert element (Create Records) and assign the field values directly in it.

I try to stick to the first approach, for no particular reason, but maybe if you try a different approach it will work for you. 
Mario CMario C
Thanks Andy.

The second point is what I am actually doing already. I will try the first approch and see what happens.
Mario CMario C

Ok, after a bit of investigation and tests, I can confidently say that there is no way to push a null value into a checkbox, but this would be well needed in a questionnaire / screen flow environment, as the questions logic may lead a simple yes/no ratio button question to be skipped. This should work in the same way the Default checkbox works with screen components, it only works if a question gets really asked and would not work if the question is skipped due to the component visibility settings. 

The workaround is simply mapping the Yes/No ratio buttons component to a picklist rather than a checkbox. In my scenario, I actually need the result as true/false, so I must convert that to checkbox using an additional formula field, or an additional field and an automation. 

Stepan StepanovStepan Stepanov
To avoid havin NULL and to store FALSE instead you could use a Boolean-Type formula. Simply 
IF({!YoutField}, TRUE,FALSE)
Then map the formula to the object field, not the screen checkbox
Johan Emerén 2Johan Emerén 2

Thanks @Stepan, I was struggling.

My formula used " [CheckboxField] = NULL ", but that didn't work, yours did!

Daniel Anthony 5Daniel Anthony 5
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information... air conditioning repair houston (https://glacialairsystems.com/)
 
Mark Miyake 3Mark Miyake 3
+1 for Stepan's answer!
Barry TinsleyBarry Tinsley
When an error occurs, automatically create a case that includes the error message and assign it to your IT department. Assign the created case’s number to a Text variable fourm .

aces etm (https://www.acesetm.me/)
 
Leonardo MacedoLeonardo Macedo
@Stepan you saved my day!
Thank you very much <3!
Richard SmithsRichard Smiths
Hey There. I found your blog using msn. This is an extremely well written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback. (https://allvendi.com/collections/moisturizer)
 
Albar KhanAlbar Khan
Thanks a lot for the info https://aperfectshinedetailing.com/
Fred RiosFred Rios
Thanks for help

MyAARPMedicare (https://www.myaarpmedicare.fit/)
Alex Peter 7Alex Peter 7
Thanks a lot for the info. You can further check more information on What On Sale (https://whatonsaletoday.com/).
Waleed Khan 8Waleed Khan 8
Hey There. This is an extremely well written article. I’ll be sure to bookmark it and return to read more of your useful info. Thanks for the post. I’ll definitely comeback.  https://youtubethumbnailsdownloader.net/how-to-create-high-ctr-thumbnails/
 
Oliver John 1Oliver John 1
Thanks a lot for the info. You can further check more information on What On Sale (Best Headlamps for Hunting (https://affordablemag.com/best-headlamps-for-hunting/))
Tonny RobinsTonny Robins
Hi Thanks for sharing very informative blog. For more info https://skateguides.com/best-skateboard-for-cruising/