Esri / Esri/arcgis-python-api

Unable to add relationship between feature layer and table in Portal

Open
#2,356 10 comments 0 reactions 0 assignees View on GitHub
help wanted question
Dominant language
Python
Stars
2.2k
Forks
1.2k
Avg merge
2h 40m
Merged PRs (30d)
2

Description

**Describe the bug**
Hi,
i'm using arcgis version 2.4.1.1 and authenticating to an on-premise portal. By following the example in this post, https://community.esri.com/t5/arcgis-api-for-python-blog/add-table-from-hosted-service-to-another-and/bc-p/1647390, i can't add relationships between the feature layer and the table.
To be precise, the statement causing the program to fail is

```python
lyr.manager.add_to_definition({"relationships": [lyr_rel_dict]})

```

The error message is poor
```
Exception: {'code': 500, 'message': "Field 'relationships' cannot be updated.", 'details': []}
```

Unfortunately, none of the comments within the post helps

Platform
- OS: Windows 11
- Python API Version: 2.4.1.1
- Python version: 3.12.11

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.