Hello - I've just began to notice that when I have layers in a Pro 2.0.1 or Pro 2.1 map that have a relationship, the related information from the one layer with a relate is then added to the second layer that does not have a relate when running the python function:
arcpy.mp.CreateWebLayerSDDraft()
In my example, I have 2 layers in an ArcPro 2.1 map and project. Parcels and a related Property table, and a second layer, Neighborhood Associations. When I create teh sddraft for Neighborhood Associations, it now contains the related info from both the Parcels AND its related table. I was able to discover this by parsing out the sddraft's xml:
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>PropertySetProperty</SPAN> <SPAN class="attr-name token"><SPAN class="namespace token">xsi:</SPAN>type</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">'</SPAN>typens:PropertySetProperty<SPAN class="punctuation token">'</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Key</SPAN><SPAN class="punctuation token">></SPAN></SPAN>PackageLayerList<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Key</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Value</SPAN> <SPAN class="attr-name token"><SPAN class="namespace token">xsi:</SPAN>type</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">'</SPAN>xs:string<SPAN class="punctuation token">'</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>CIMPATH=planning/prod_gis_neighborhoodview.xml<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Value</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>PropertySetProperty</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
.....
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>PropertySetProperty</SPAN> <SPAN class="attr-name token"><SPAN class="namespace token">xsi:</SPAN>type</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">'</SPAN>typens:PropertySetProperty<SPAN class="punctuation token">'</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Key</SPAN><SPAN class="punctuation token">></SPAN></SPAN>DependantTableList<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Key</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>Value</SPAN> <SPAN class="attr-name token"><SPAN class="namespace token">xsi:</SPAN>type</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">'</SPAN>xs:string<SPAN class="punctuation token">'</SPAN></SPAN><SPAN class="punctuation token">></SPAN></SPAN>EXTERNALPATH=PROD::PROD.GIS.BuildingDetails|EXTERNALPATH=PROD::PROD.GIS.PROPERTY<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>Value</SPAN><SPAN class="punctuation token">></SPAN></SPAN>
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>PropertySetProperty</SPAN><SPAN class="punctuation token">></SPAN></SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
and by then simply looking at the hosted feature layer after I run the update:
My Neighborhood Associations layer now contains Parcels and it's related tables a layers. That can't be right, and this started happening with the patch release at 2.0.1 as near as I can tell.
You can also see this with our utility water system valves here:
https://sarco.maps.arcgis.com/home/item.html?id=cf962eed5cd3478b8bf71839db8ec423#overview
In this case, the arcpy.mp.CreateWebLayerSDDraft() function thinks that all these layers are related through attachments.
This is happening to any layer that has any relate or attachment relate. I have tried sourcing both our 10.5.1 Enterprise SQL or File GDB.