Dynamic value == null output as 'null' and not *nothing* after form reset

I have no problem with dynamic attribute value with null value to output nothing into form input but the problem is when the form is reset using dynamic event then the input with null value will literally output the ‘null’ text into the input.

Annotation 2020-08-28 120042

Can I get this to be fixed so that whenever after the form is reset, dynamic value with null value will output nothing instead of ‘null’ text. I use data detail to trigger the form value for update form. The expected cycle is as follows:

click > data-detail + open modal > dynamic form [null value doesn’t output anything - OK ]> close modal + form reset > click again > data-detail + open modal > dynamic form [null value shown as null text - Not OK]

Please test this update: dmxAppConnect.zip (21.8 KB)

1 Like

Kudos. No more ‘null’ word with this update. Thank you!

Thanks for this @patrick… I’ve had this issue for a long time too and have been frenetically adding default values to every database field in sight!

Will this be part of the update next week?

Best wishes,
Antony.

Another situation where you will still need to set default values (AFAIK) is if you use fields in tables with sortable headers. Where fields in some records could contain null values, you will get some strange results. I would be careful before removing all the default values.

I have this issue with both tables and data views where data from previous server calls shows in the results for the subsequent call if null values are present. Is this the same issue you are referring to as strange results.
First Call - Shows correct values

Second Call (changed query parameter with select) and it shows the previous calls values where nulls are present even though the serverconnect shows the correct data.

This seems like a bug to me?

Thanks, Paul

Hi Paul,

Are you using a unique key for the repeat children component? That should prevent the behavior you are seeing.

Ken, I’ve never quite understood this “unique key” aspect of repeat children… do you just specify it in the repeat child declaration, or is it useful somewhere in your following code? :thinking:

In fact I don’t really get repeat children versus normal repeat… maybe I’ll start a thread about it…

Yes, use it in the KEY option in the UI.
As I explained you in another topic:

The repeat children is the actual repeat component in App Connect, the other one - repeat is a dynamic attribute.

Only component have properties, data and events which you can use.

Yes. I think this originally came up in this thread, long ago. I don’t think it’s been acknowledged as a bug, but it’s certainly unexpected/unwanted behaviour.

It’s cropped up quite a few times and will doubtless continue to do so unless some note about it appears, probably somewhere within the table generator.

Thank you all for your responses, adding a unique key to the repeat fixed the issue. I just now need to go through all my pages and change them as the risk of showing the wrong data presented as the correct data to the end user is a major concern.

As per TomD’s original thread I think this needs to be clearer in the table generator and the tooltip, I read the tooltip before for this field and never set it as it didn’t seem to apply.

@patrick I just want to add that this update also somehow fixed another related issue I was about to report.

Before this I was not able to use null in ternary operation because it will output ‘null’ instead of nothing.

For example I had to write !value ? 1 : '' instead of !value ? 1 : null.

Other than above, I think dynamic action set value was also affected. I’ve replaced all the '' in my code to null and they work as expected this time.

I hope this fix will be maintained and brought forward in the upcoming update. Cheers.