Creating A Google Calendar Appointment Using Inline Field Values From A Specified Task As URL Parameters

I am working on my Task Workflow to schedule Tasks from Obsidian on my Google Calendar.

I am currently using the community plugin Checklist by delashum. (I am open to change.)

The ultimate goal is to generate an external link for each task that I can click to create a Google Calendar appointment from an URL.

A great article about the url parameters for a Google Calendar appointment can be found here: Adding Events to a Google Calendar via a Link - Dylan Beattie

I have inline fields setup for each task such as [source:: ] and am using the elink() function to pass the inline field values into an external link as URL parameters as suggested by @mnvwvnm here: Obsidian URL from dataview links. Simplified example below:

`=elink("https://www.google.com/search?q=" + this.file.tasks.source, "Link to " + this.file.tasks.source)`

The problem I am running into is how to return inline field values for one single specific task on a page that contains multiple tasks. For example:

#todo
- [ ] TASK1 [scheduled:: ]  [due:: ]  [length:: 1h0m]  [date_created:: 2023-12-07 17:22:04]  [source:: IT-18688-DIR]  [affordability:: 0]  [delegable:: false]  [billable:: false]  [importance:: 0]  [urgency:: 0]  [context:: ]  [ondeck:: false]  [top6:: false]  [my_one_thing:: false]   [cancelled:: false]   Click here to create calendar appointment: `=elink("https://www.google.com/search?q=" + this.file.tasks.source, "Link to " + this.file.tasks.source)` 
- [ ] TASK2 [scheduled:: ]  [due:: ]  [length:: 1h0m]  [date_created:: 2023-12-07 17:22:04]  [source:: Different]  [affordability:: 0]  [delegable:: false]  [billable:: false]  [importance:: 0]  [urgency:: 0]  [context:: ]  [ondeck:: false]  [top6:: false]  [my_one_thing:: false]   [cancelled:: false]   Click here to create calendar appointment: `=elink("https://www.google.com/search?q=" + this.file.tasks.source, "Link to " + this.file.tasks.source)`    

The property this.file.tasks.source returns both “IT-18688-DIR” from TASK1 and “Different” from TASK2.

2023-12-09_070411_TLF-HV1DVZ2-annotated

The desired behavior would be for it to only return one value for the “Source::” inline field for each separate task.

Is there a property specific to a task, e.g. this.task? Or is there an alternative way to return inline field values for each task?

If there were a specific property for each task such as this.task, I would assume it would return everything after the checkbox, including the inline fields. To bring everything together, what would be the cleanest way to exclude any text after “[” (the opening bracket of the first inline field) so that I can pass the task (e.g. TASK1) separately along with other inline fields as URL parameters to create the Google Calendar event?

`=elink("https://calendar.google.com/calendar/u/0/r/eventedit?text=" + this.task + "dates=" + this.task.scheduled + "/" this.task.calculatedEnd)`

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.