Extracting start date from a timeline

Hello Community,

I am using N8N to automate something but I have run into an issue.

My goal:
When timeline start date arrives, move item to next group.

Since you simply cannot use the timeline start date in an automation for some reason or use it in a formula the correct way as you can also not use formulas in automations, I tried using General Caster to cast the start date to a new column but GC also does not support timelines, the support sadly has not been helpful either.

I have now tried doing it in N8N but since I am not a coder I dont know how to properly extract the start value from the timeline.
When I connect monday to it I can select the column, or column value, which shows it like this:
"value": "{"from":"2021-06-10","to":"2021-10-15","changed_at":"2021-02-04T13:03:05.221Z"}"
How do I extract the “from” from this? You can do functions on N8N using Javascript but as I said, I am not a coder and do not have a clue how to do it.

items[0].json.theZeitraum = items[0].json.column_values.find(x => x.id === 'timeline');
works to get the column values but as I said, I only need the from.
I also tried timeline.start, timeline.value, timeline.value.from, timeline.from but none of these work. I hope Mondayteam can help me.

By a suggestion I have seen your name, @MondayUsernonDevelop , may you assist me?

Hi @MNie!

Nice to meet you-- I work for the developer success team here at monday.com and would be happy to help.

In full transparency, I’m not familiar with N8N. I’m assuming the result you’re getting is in JSON formatting? If so, it would help to turn it into a Javascript object so that you can extract the different “fields” from the object, the “from” field being one of them.

Do you mind including a screenshot of what you’re getting returned?

Thanks!
Helen

Hello @Helen,
thank you for trying to help me.
When I get info from monday it looks like this:


(This is the only thing thats relevant, I also get info for every other column or the item itself (for example pulse id))

The “from” value is what I need.
It needs to be put into a JSON to work. The current one looks like this:
Bildschirmfoto 2021-02-23 um 10.03.51
Which I can select from all nodes (output and input) in my n8n-workflow.

So no-code is basically a dream not yet achieved here but if I knew how to do it it would be no problem. I have less than basic knowledge of javascript and absolutely no clue how a Json works or what a node even is.

I hope you can assist me with this.

Of course! Happy to help.

It looks like N8N is just another integration app, something like Zapier and/or Integromat. Personally, I would recommend utilizing something like Integromat, but that’s just the platform I’m most familiar with.

In any case, the value field of the “value” object is just another JSON object! Put it another way, the data you’re getting from monday.com is a JSON object, and the value information is a JSON object within this larger JSON object.

I’m not 100% sure if this is something you’re able to do, but I would assign the expression you sent over to be some variable, and then perform the same expression again, on this new variable, to isolate the “from” information. Does this make sense? Are you able to assign variables?

Hey!

i had to get some values like this in my projects, and one thing i did was to parse de value as a json
in your case, it would be something like JSON.parse(your JSON object.value)
this should transform that stringified JSON into a JSON object, and then you could just get the “from” value as you would normally with any JSON object

hope i could explain it well and it helps you

1 Like