Select to view content in your preferred language

Update a Record - Updating a single field(s) without nulling or having to include all parameters

75
2
Thursday
JohnEvans6
Frequent Contributor

I'm hopeful this is a me problem as I'm new to this connector. I simply want to update a record in a feature layer without nulling out all of the other values in my layer on update. I don't know exactly which fields in my layer I'll be updating on any given update; it could be 1 field or 6 fields.

In the below example, I only want to update the Notes based on an event ID

{"EventID":"FE-2363","EntryType":"Update","Notes":"Scheduled Bla Blah. 1200-2100 UTC. Daily through 8/14"}

 

An object stores my update. My object will not have all keys/fields present for an update. Any fields missing from my update I just want to leave as-is.  I'm seeing that because I have mapped a non-existent key to a parameter, it is setting it to null and, on send, does exactly what I'm telling it

variables.pngconnector_sends_null.png

Is there a way to send an update to specific fields without an impossible number of conditionals? If OCR type is not a key in my object, I don't want to send null I want it omitted from the update. But sometimes it will be present.

I couldn't find a related post, but if there is I'll happily take a link.

Thanks!

0 Kudos
2 Replies
MichaelAscher
New Contributor

Can you use the "get data from feature layer" action and then use an expression to check if your variable contains information?

If yes, then use that information in that field otherwise use the data grabbed from the mentioned action?

You would need an expression in each field of your feature you want to update.  Clear as mud I'm sure. 🙂

JohnEvans6
Frequent Contributor

Yeah that happens to be right where I landed with this 🙃. If it helps in future, or helps me when I have to do this again in a year and have no idea how to:

Get Data from a Feature Layer as JSON Via where query so I only return 1 record

JohnEvans6_0-1755273272485.png


Assign value of attributes to object. I have a compose afterwards that "saves it". It's probably unneeded but it finally works so I don't want to touch it.

JohnEvans6_1-1755273333326.png


Assign my AGOL attributes to an second object. These keys match the object that has my update(s):

JohnEvans6_2-1755273544424.png

Apply to Each: For each of my parsed records i set key and value to a variable. Whichever key/value pairs I receive, update the object. It'll just ignore any AGOL values i haven't parsed.

JohnEvans6_3-1755273770721.png

 

Send my update. Feels goofy I have to make an extra query and set up like a whole separate flow. Programming is easier than this 😅

0 Kudos