Select to view content in your preferred language

ViewInTable Data Action

490
3
11-01-2023 08:47 AM
JillianStanford
Frequent Contributor

Hello!

I am developing a custom ExB widget. The widget creates a CSVLayer and adds it to the map. I would also like to add it to the attribute table.

After a lot of hunting and pecking, I managed to get a hold of the "viewInTable" data action but I can't get it executed. I believe I need to somehow cast the CSVLayer as a DataRecordSet.

Does anybody have a working example of this?

Thanks!

Jill

3 Replies
SerjStol
Frequent Contributor

@JillianStanford did you ever figure this out? I want to programatically add Tables from hosted feature layer directly to Table Widget, similar to Add To Table Data Action.

0 Kudos
JillianStanford
Frequent Contributor

I cobbled something together that worked for my specific use case. I posted it here - https://community.esri.com/t5/arcgis-experience-builder-questions/custom-widget-output-datasource/m-...

 

 

SerjStol
Frequent Contributor

I've figured out how to trigger AddToTable data action, which would work for ViewInTable as well, they are pretty much the same just one is on Data Source level and another is on Records level. For CSVLayer I think you first need to make DataSource from it, then you can easily getRecords() to get records and pass all required parameters to onExecute. See code here: Solved: Re: Adding Tables and Layers to Table Widget progr... - Esri Community