@@ -526,8 +526,9 @@ function MoneyReportHeader({
526526
527527 const [ offlineModalVisible , setOfflineModalVisible ] = useState ( false ) ;
528528
529- const exportSubmenuOptions : Record < ValueOf < typeof CONST . REPORT . EXPORT_OPTIONS > , DropdownOption < ValueOf < typeof CONST . REPORT . EXPORT_OPTIONS > > > = useMemo (
530- ( ) => ( {
529+ const [ integrationsExportTemplates ] = useOnyx ( ONYXKEYS . NVP_INTEGRATION_SERVER_EXPORT_TEMPLATES , { initialValue : [ ] , canBeMissing : false } ) ;
530+ const exportSubmenuOptions = useMemo ( ( ) => {
531+ const options : Record < string , DropdownOption < string > > = {
531532 [ CONST . REPORT . EXPORT_OPTIONS . DOWNLOAD_CSV ] : {
532533 text : translate ( 'export.basicExport' ) ,
533534 icon : Expensicons . Table ,
@@ -588,9 +589,22 @@ function MoneyReportHeader({
588589 markAsManuallyExported ( moneyRequestReport ?. reportID , connectedIntegration ) ;
589590 } ,
590591 } ,
591- } ) ,
592- [ translate , connectedIntegrationFallback , connectedIntegration , moneyRequestReport , isOffline , transactionIDs , isExported , beginExportWithTemplate ] ,
593- ) ;
592+ } ;
593+
594+ // If the user has any custom integration export templates, add them as export options
595+ if ( integrationsExportTemplates && integrationsExportTemplates . length > 0 ) {
596+ for ( const template of integrationsExportTemplates ) {
597+ options [ template . name ] = {
598+ text : template . name ,
599+ icon : Expensicons . Table ,
600+ value : template . name ,
601+ onSelected : ( ) => beginExportWithTemplate ( template . name , CONST . EXPORT_TEMPLATE_TYPES . INTEGRATIONS , transactionIDs ) ,
602+ } ;
603+ }
604+ }
605+
606+ return options ;
607+ } , [ translate , connectedIntegrationFallback , connectedIntegration , moneyRequestReport , isOffline , transactionIDs , isExported , beginExportWithTemplate , integrationsExportTemplates ] ) ;
594608
595609 const primaryActionsImplementation = {
596610 [ CONST . REPORT . PRIMARY_ACTIONS . SUBMIT ] : (
@@ -732,8 +746,8 @@ function MoneyReportHeader({
732746 if ( ! moneyRequestReport ) {
733747 return [ ] ;
734748 }
735- return getSecondaryExportReportActions ( moneyRequestReport , policy , reportActions ) ;
736- } , [ moneyRequestReport , policy , reportActions ] ) ;
749+ return getSecondaryExportReportActions ( moneyRequestReport , policy , reportActions , integrationsExportTemplates ) ;
750+ } , [ moneyRequestReport , policy , reportActions , integrationsExportTemplates ] ) ;
737751
738752 const secondaryActionsImplementation : Record <
739753 ValueOf < typeof CONST . REPORT . SECONDARY_ACTIONS > ,
0 commit comments