Select to view content in your preferred language

Not able to write for in loop

175
0
04-06-2024 05:33 AM
Manager_HMWSSBCDC
New Contributor III
var item_id = '99646c55510049a583bc1fe853c7f5f0';
var fields1 = ['can','closingdate','objectid'];

 

var fs1 = FeatureSetByPortalItem(portal, item_id, 4, fields1, false);

 

var can_2023 = Date(2023, 11, 31)

 

var filtered1 = Filter(fs1, 'closingdate <= @can_2023')

 

var can_2024 = Date(2024, 0, 1)

 

var filtered2 =  Filter(fs1, 'closingdate >= @can_2024')

 

var features = [];
var feat;

 

for (var f in filtered2) {
  feat = {
    'attributes': {
      'year' : f['closingdate'],
      'can' : f["can"]
    }}

 

  }

 

return feat

When I execute this code, in the output it buffering but not giving any output. can anyone suggest a solution for this.
0 Kudos
0 Replies