56
Views
6
Comments
Solved
[Advanced Date Picker] How to save selected dates in database, inside a single record?
advanced-date-picker
Reactive icon
Forge asset by Steven Decock
Application Type
Reactive

I am using this advance date picker to pick multiple dates, now i have to save those dates in the "Date" attribute in my entity inside a single record.

how can i do that??

2020-03-12 15-06-24
Steven Decock
Solution

You can always serialize the list of dates to JSON and persist the JSON string.  If the list might get really long, it might be best to persist the JSON string as Binary.

Then you can do JSON deserialize when you fetch the data again.

2025-09-21 06-51-05
Mohd Anees Mansoori

It worked.

Thank you.

2025-09-21 06-51-05
Mohd Anees Mansoori

hey @Steven Decock 

How to get that JSON data again in the form of date list.

For every single record in an entity???

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Loop over it with a For Each and use DeserializeJson.

UserImage.jpg
Kay Lun

I guess the best thing you could do might be concate them into a single string, then save in the entity attribute, and when you pull the data back, you have to split them back into multiple string, and convert them using the TextToDate() to convert back to a Date List

2020-03-12 15-06-24
Steven Decock
Solution

You can always serialize the list of dates to JSON and persist the JSON string.  If the list might get really long, it might be best to persist the JSON string as Binary.

Then you can do JSON deserialize when you fetch the data again.

2025-09-21 06-51-05
Mohd Anees Mansoori

It worked.

Thank you.

2025-09-21 06-51-05
Mohd Anees Mansoori

hey @Steven Decock 

How to get that JSON data again in the form of date list.

For every single record in an entity???

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Loop over it with a For Each and use DeserializeJson.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Mohd,

What's the reason you need to save it in a single record? Can't you add an entity that references the record and holds a date?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.