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

merge same field in multiple tables #24

Closed
tolot27 opened this issue Jul 19, 2024 · 3 comments
Closed

merge same field in multiple tables #24

tolot27 opened this issue Jul 19, 2024 · 3 comments

Comments

@tolot27
Copy link

tolot27 commented Jul 19, 2024

I have several tables in my docx template which have an identifier column in common. If I specify a merge field with the same field name and use merge_rows, only the first table is populated with the rows.

How can I apply merge_rows to every table which contains the same field name specified in merge_rows?

Your Environment

  • Python version: 3.8.10
  • docx-mailmerge version: 0.8
@iulica
Copy link
Owner

iulica commented Jul 19, 2024

Hi,

let me see if I understood it correctly. You have several tables that should be filled with the same data, right?

One workaround would be to just use a different identifier and fill the data separately.

I will look into the code to see if there is a problem there.

@tolot27
Copy link
Author

tolot27 commented Jul 19, 2024

You got it right. Your proposed workaround requires to duplicate the json data in python with different identifiers several times (=number of tables).

Maybe https://github.com/iulica/docx-mailmerge/blob/master/mailmerge.py#L571 can be repeatedly called until it returns None?

@iulica
Copy link
Owner

iulica commented Jul 19, 2024

Fixed, and released 0.8.1 . Please wait a little bit for the release to be published and then check if it works.

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

2 participants