Hello everyone!
I’m building an app that has a calendar where all the jobs will be added. I have a three total dates that I need on the calendar: scheduled date, issue date and pick-up date. there’s a job that contains only scheduled date, another type of job that only contains issue date, and then another one with pick-up date. but I have two additional types of job that contain both scheduled date and pick-up date. I need these jobs to show on the calendar for both dates, so for example if the job’s schedule date is today and the pick-up date is next week, I want this job to show on the calendar both today and next week. I tried using the if then else logic, but it only shows one date instead of two for those jobs with two dates, therefore, it only shows once on the calendar. is there any way I can have it show both dates using this logic? Please let me know!!!
Thank you in advance!!!
This is what I mean, it only shows one date when there should be two for some jobs. I tried using a template, but the calendar component doesn’t allow template as an option for date input.
First of all, the IF column will return the first true instance. It’s not meant to return all true instances. Once it finds a true instance it stops and returns that value.
Second, what you are trying to do is not possible. The calendar can only look at a single date column. I think your best bet is to restructure your data so you only have one date column. If a job has multiple dates, then it will need to have multiple rows.
An alternative is to have a separate dates table that relates to your job table, point the calendar at the dates table, and use lookup columns to pull job data you need to show on the calendar for each date.
Another alternative is to play around with the custom AI component and try to convince it to create a nice calendar that can look at multiple date columns.
Thank you! It’s a shame it can’t work with the IF logic. For the AI component, I thought it only shows a single row of data, can it show all the rows?
Thank you for getting back to me!
You can put an ai component in a custom collection tho!
IF logic is always designed to return a value when the first IF condition is met. Pretty standard with any programming language. What you probably really wanted was something like a template or make array to join multiple values together, but it’s still not going to work in your case.
Usually when I need to show multiple rows of data in a custom component, I will create a JSON object for each row, then a lookup column to return all JSON objects to a single row, and finally create another JSON object from that lookup column. Then I bind the JSON object column to the custom component.
2 Likes