Select to view content in your preferred language

Passing parameters to the featureLayer.calculate

2396
10
Jump to solution
08-12-2021 11:41 AM
ChuckBenton
Frequent Contributor

I'm sure this is a simple issue, but it's stumped me.

The following line executes without issue:

fs_layer.calculate(where="FIPS=18039", calc_expression={"field":"VERSION", "value": "07/04/2021"})

This fails:

where_str = '"FIPS=18039"'
calc_str = '"field":"VERSION", "value":"07/10/2021"'
fs_layer.calculate(where=where_str, calc_expression={calc_str})

Ultimately I want to iterate the fs_layer.calculate line in a loop, passing different FIPS and VERSION values each time.

I've tried multiple ways to build the parameters to be passed, building the entire argument, varying quote schemes, and so on. What am I missing?

0 Kudos
10 Replies
ChuckBenton
Frequent Contributor

That did it. Thanks!!