Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update entries trough Notion [Part 2 not working] #33

Open
astronaut954 opened this issue Apr 21, 2024 · 0 comments
Open

Can't update entries trough Notion [Part 2 not working] #33

astronaut954 opened this issue Apr 21, 2024 · 0 comments

Comments

@astronaut954
Copy link

THE ISSUE:
In short, my python script won't allow any update in an already existing event through Notion. The "Part 2" of the script doesn't work.

DETAILS OF THE ISSUE:
Whenever I try to update an event on Notion the "result_list" variable (just after the attribution of the variable "my_page") it returns an empty list, so it isn't running both "if" blocks from the part 2:

if len(resultList) > 0:
    for i, el in enumerate(resultList):
        pageId = el['id']
        my_page = notion.pages.update( ##### This checks off that the event has been put on Google Calendar
            **{
                "page_id": pageId, 
                "properties": {
                    Calendar_Notion_Name:  { 
                        'select': {
                            "name": DEFAULT_CALENDAR_NAME
                        },
                    },
                    LastUpdatedTime_Notion_Name: {
                        "date":{
                            'start': notion_time(),
                            'end': None,
                        }
                    }, 
                },
            },
        )

WHAT HAS BEEN OBSERVED:

  • I had "printed" the "result_list" variable and it was observed as an empty list.
  • I suspect that the "result_list" variable its been pulled from the wrong place.
  • When updating the data from an already existing entry (both entries on Google Calendar and Notion) directly from Notion (eg. changing the date from 24/04 to 22/04) the code prioritizes the data of Google Calendar overwriting the data of Notion to the Google Calendar data (eg. returning to day 24/04 on Notion).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant