Select to view content in your preferred language

Create Related Record But Not Parent Feature

333
9
12-05-2024 01:21 PM
gargarcia
Regular Contributor

Is it possible to allow users to create a tabular related record, but not a parent geometry feature with the edit widget?

If I change the widget settings to allow update only I lose the ability to create a new related record. When Interact with a map widget is selected the user can create a related record but also the template shows on the edit widget allowing them to create geometry features.

0 Kudos
9 Replies
ZachBodenner
MVP Regular Contributor

I think your hands might be tied - Experience Builder (and kind of the new map viewer in general) is still a bit behind in dealing with related records. Recently updates have allowed for viewing them, but I think the only way you can add records by themselves is with hosted layers in AGOL.

Happy mapping,
- Zach
0 Kudos
AustinAverill
Emerging Contributor

Within Experience Builder this is not currently supported through any of the available widgets. That being said, I have some up with some pretty nifty (albeit mind numbing) solutions.

Right now I have an almost entirely tabular data driven application running in experience builder using a hosted feature service as the data base. I use tables (you could use a map to select points) to select the parent record and then a dynmaic url on a button that fills in the parent relation information into a Survey123 form through URL parameters. Doing something like this on top of an already developed feature service requires the use of Survey123 Connect to produce, but it is definitely a great solution.

I have had this set up for approximately a year at this point for people with limited tech literacy and they have had an easy and successful time interacting with it.

ZachBodenner
MVP Regular Contributor

That's kind of genius actually.

Happy mapping,
- Zach
0 Kudos
AustinAverill
Emerging Contributor

I've noticed that you can also send data to the survey based on your selection with the survey widget's configuration options. I never tried this because of the shear number of surveys that my application supports, but if you are only dealing with one related table you are working on, this might be an option too.

0 Kudos
kmsmikrud
Frequent Contributor

Hi @AustinAverill,

That does sound like a novel way editing. For the survey123 form, when users submit the form currently in a web app I've worked on I have it so it will update the EB, but it takes like 3 seconds and then refreshes the entire application and form. Do you users do this each time? I was just wondering if there was a smoother way to have the EB update without a complete refresh.

Thanks!,

Kathy

 

0 Kudos
AustinAverill
Emerging Contributor

So if it is just one form, you should be able to, in theory, use the survey wideget to accomplish. You will need the survey set to refresh on submit after however many seconds and increase the layer refresh in the layer properties pane to be 30 seconds. Even by doing this, you will only get a 30 second refresh. With tabular data, the table widget has a built in refresh button, and the search function in the table updates automatically because it is querying the table to produce suggestions. 

 

For web maps, you should in theory be able to force a reload of the data set by changing extent, as this will cause the features to be queried from the feature service.

I have for sure not used it in this way before though. Just sort of guessing based on the way ExB and AGOL work.

0 Kudos
kmsmikrud
Frequent Contributor

Thanks AustinAverill, I can try this out. In reality we have 2 related forms to have surveyors add new records two based on two hosted AGOL polygon layers (1 to many relationship). In addition another point layer is edited. I have added arcade statements to the web map form for fields to autopopulate based on the polygon relationship. I will look into the survey form though option because at this point, the geometry of the polygon being edited by mistake isn't a great option. I really appreciate the info on the different layer refresh settings too. 

0 Kudos
ChristopherCounsell
MVP Regular Contributor

Yes this is possible by updating the service definition of the Hosted Feature Layer. You can add layer overrides on the sub layers, changing the editing capabilities available on each record. I have done this for the scenario you have mentioned. Here is a guide on how to do this:

https://youtu.be/dM-hX6nnyK4?t=2330

HOWEVER it is extremely annoying to maintain:

  • The layer overrides are only visible via the Admin REST API
  • There is no indication that layer overrides are in place on the item itself, and it will show editing settings that do not match the actual layer capabilities.

This makes for extremely confused GIS staff later on. I would recommend:

  • Using a Hosted Feature Layer View, and not modifying the capabilities on the original feature service
  • Ensuring you tag and add metadata so that you (or someone else) realizes that this service has been modified
  • Not using the View elsewhere

 

kmsmikrud
Frequent Contributor

Hi,

I feel like we are trying to achieve the same goal of adding related tabular records but not updating anything on the parent feature geometry. I have a similar post   and have still been struggling with the parent geometry allowing edits even though I have all the edit widget settings for the parent layer disabled besides having it as a layer for editing (but I have I add, delete and update radio buttons all turned off), yet I can still I still create, edit, and update the parent polygon? I didn't know about the layer overrides and is an interesting concept to explore and appreciate the advice to create a view with metadata noting these changes.

Just thought I would commiserate,

Kathy

 

0 Kudos