<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python CIM - Why can't I Include both Text and Fields in PopUp? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-cim-why-can-t-i-include-both-text-and/m-p/1701673#M103157</link>
    <description>&lt;P&gt;My automation of building popups from Python code has been working ok.&amp;nbsp; I can configure the title, the fields to be included (and order of those fields) and whether to show attachments or not.&lt;/P&gt;&lt;P&gt;I now want to include a link to an external web page.&amp;nbsp; Doing this manually in a popup 'Text' item works fine.&amp;nbsp; So I thought I should also be able to do this in my Python code.&amp;nbsp; The relevant code is below&lt;/P&gt;&lt;P&gt;If I comment out the code for the Fields table item (CIMTableMediaInfo object), then the text item (the link) shows up in the popup and works.&amp;nbsp; If I comment out the code for the Text item (CIMTextMedioInfo object), then the Fields table shows up in the popup nicely.&amp;nbsp; This implies that I'm using correct Python code for each item because they work just fine that way.&lt;/P&gt;&lt;P&gt;However, if I attempt to have BOTH items included, the popup shows up blank.&amp;nbsp; Looking at the popup configuration in ArcGIS Pro reveals that it has neither a Text item, nor a Fields table item.&amp;nbsp; Instead, it shows only a Carousel item (with default settings).&amp;nbsp; I never asked for a Carousel item!?!?&lt;/P&gt;&lt;P&gt;The relevant Python code is below.&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&amp;nbsp; How can I fix this code to work for both a Text item AND a Fields table item?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    media_infos = []
    cim = lyr.getDefinition('V3')
    cim.popupInfo = arcpy.cim.CIMPopupInfo()
    if configure_title:
        cim.popupInfo.title = os.path.basename(lyr_name) + ": {name}"
    if 'asset_id' in popup_fields:
        link_text_info = arcpy.cim.CIMTextMediaInfo()
        link_text_info.text = asset_link
        media_infos.append(link_text_info)
    if configure_fields_list:
        table_media = arcpy.cim.CIMTableMediaInfo()
        table_media.fields = popup_fields
        media_infos.append(table_media)
    cim.popupInfo.mediaInfos = media_infos
    lyr.setDefinition(cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2026 01:20:13 GMT</pubDate>
    <dc:creator>GISDataTasPorts</dc:creator>
    <dc:date>2026-05-13T01:20:13Z</dc:date>
    <item>
      <title>Python CIM - Why can't I Include both Text and Fields in PopUp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cim-why-can-t-i-include-both-text-and/m-p/1701673#M103157</link>
      <description>&lt;P&gt;My automation of building popups from Python code has been working ok.&amp;nbsp; I can configure the title, the fields to be included (and order of those fields) and whether to show attachments or not.&lt;/P&gt;&lt;P&gt;I now want to include a link to an external web page.&amp;nbsp; Doing this manually in a popup 'Text' item works fine.&amp;nbsp; So I thought I should also be able to do this in my Python code.&amp;nbsp; The relevant code is below&lt;/P&gt;&lt;P&gt;If I comment out the code for the Fields table item (CIMTableMediaInfo object), then the text item (the link) shows up in the popup and works.&amp;nbsp; If I comment out the code for the Text item (CIMTextMedioInfo object), then the Fields table shows up in the popup nicely.&amp;nbsp; This implies that I'm using correct Python code for each item because they work just fine that way.&lt;/P&gt;&lt;P&gt;However, if I attempt to have BOTH items included, the popup shows up blank.&amp;nbsp; Looking at the popup configuration in ArcGIS Pro reveals that it has neither a Text item, nor a Fields table item.&amp;nbsp; Instead, it shows only a Carousel item (with default settings).&amp;nbsp; I never asked for a Carousel item!?!?&lt;/P&gt;&lt;P&gt;The relevant Python code is below.&lt;/P&gt;&lt;P&gt;What am I doing wrong here?&amp;nbsp; How can I fix this code to work for both a Text item AND a Fields table item?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    media_infos = []
    cim = lyr.getDefinition('V3')
    cim.popupInfo = arcpy.cim.CIMPopupInfo()
    if configure_title:
        cim.popupInfo.title = os.path.basename(lyr_name) + ": {name}"
    if 'asset_id' in popup_fields:
        link_text_info = arcpy.cim.CIMTextMediaInfo()
        link_text_info.text = asset_link
        media_infos.append(link_text_info)
    if configure_fields_list:
        table_media = arcpy.cim.CIMTableMediaInfo()
        table_media.fields = popup_fields
        media_infos.append(table_media)
    cim.popupInfo.mediaInfos = media_infos
    lyr.setDefinition(cim)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2026 01:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cim-why-can-t-i-include-both-text-and/m-p/1701673#M103157</guid>
      <dc:creator>GISDataTasPorts</dc:creator>
      <dc:date>2026-05-13T01:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python CIM - Why can't I Include both Text and Fields in PopUp?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-cim-why-can-t-i-include-both-text-and/m-p/1701675#M103158</link>
      <description>&lt;P&gt;I've resolved this by adding the code below before (and including) the last two lines:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    for i, info in enumerate(media_infos):
        info.row = i
    cim.popupInfo.mediaInfos = media_infos
    lyr.setDefinition(cim)&lt;/LI-CODE&gt;&lt;P&gt;Ie, it appears that each CIMMediaInfo object needs to have a row number configured. Or at least in some circumstances (as this wasn't required when I had just Fields table and attachments items).&lt;/P&gt;&lt;P&gt;The documentation is either terrible, or I'm just hopeless at trying to find/understand the documentation. Either way, I just tried this as an experiment and was pleasantly surprised to find that it worked.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2026 01:45:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-cim-why-can-t-i-include-both-text-and/m-p/1701675#M103158</guid>
      <dc:creator>GISDataTasPorts</dc:creator>
      <dc:date>2026-05-13T01:45:51Z</dc:date>
    </item>
  </channel>
</rss>

