I developed a Google Sheets add-on called Pivot Expense Split with several templates. User needs to make a copy of a template before using it. In the template, I ran below to save a template ID 'T1':
SpreadsheetApp.getActive().addDeveloperMetadata('template', 'T1', SpreadsheetApp.DeveloperMetadataVisibility.DOCUMENT);
When user activiate my add-on on the copy, I have below to read the template ID 'T1':
var value = SpreadsheetApp.getActive().createDeveloperMetadataFinder().withKey('template').find();
var template = value[0].getValue();
From the Apps Script activity log, I noticed that after installation, users open my setup page:
https://spcsoft-galaxy.blogspot.com/p/pivot-expense-split-setup.html
I suppose user has copied the template. My log shows that the activation function was ran several times but my script could not find the template ID.
I tested the same flow myself (install → copy template → activate), and activation works fine on my end.
Could anyone help me identify what might cause this issue? Any suggestions or troubleshooting ideas are appreciated!